[PR #1899] check_no_game_data: inspect legacy V7 tar archives #1910

Open
opened 2026-11-26 21:19:22 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1899
Author: @XeNS1
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: codex/check-no-game-data-v7-tar-20261125


📝 Commits (1)

  • 7dcca92 fix(check-no-game-data): inspect legacy V7 tar archives

📊 Changes

2 files changed (+73 additions, -2 deletions)

View changed files

📝 scripts/check_no_game_data.py (+9 -2)
📝 tests/test_check_no_game_data.py (+64 -0)

📄 Description

Claimed in the coordination issue as: CHECK-NO-GAME-DATA-V7-TAR
https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7166283601

Related: #1024 handles explicit-path validation in the same files; that separate behavior is unchanged here.

What and why

A valid V7 tar archive has no ustar marker. Saved under a harmless name such as .bin, it previously passed check_no_game_data.py without its members being inspected, even if a member started with a prohibited binary-format header.

Recognize legacy archives by validating their first 512-byte header through tarfile.TarInfo.frombuf. The existing ustar detection still identifies damaged modern tar archives as unchecked. Member inspection continues through the existing depth, expanded-byte and member-count budgets.

Add generated synthetic fixtures covering raw V7 tar, gzip/bzip2/xz compression, ZIP nesting, a clean first member followed by a synthetic DDS header, clean text-only archives, and non-archive controls. All binary fixture bytes are generated in temporary directories; no game files are included or needed.

Tested

Linux x86-64, Python 3.14.8, CPU only:

  • python3 -I tests/test_check_no_game_data.py: 15 tests passed.
  • python3 -I tests/test_no_game_data_workflow.py: 3 tests passed.
  • Regression proof: all five cases in the new V7 detection test fail against the unchanged scanner and pass with the fix.
  • tests/test_text_write_line_endings.py: 3 tests passed.
  • Full semantic suite: 489 files, 6,288 tests, zero failed files, 213 seconds with 2 workers. This was run before rebasing; the only subsequent upstream changes were runtime/CMakeLists.txt and runtime/test/d3d12_title_va_test.cpp, so the Python sources and semantic fixtures are identical.
  • compileall for make_game.py, tools, tests and the changed scanner; make_game.py --help; changed-file game-data scan; git diff --check: passed.
  • Known baseline failure: test_runner_calls_all_tests.py reports the uncalled test_feature_scan.py::test_out_named_like_the_optional_spirv_index. The same failure was reproduced on a separate clean upstream worktree. Neither file is changed here.

GPUs tested: n/a; CPU-only checks. No game installation was accessed.

AI-assisted: yes, OpenAI Codex.

Checklist

  • Rebased on current main without conflicts.
  • One topic.
  • No game data, keys, decryption or game-derived logs in the change or report.
  • No translator rule changed; contract-table update is not applicable.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1899 **Author:** [@XeNS1](https://github.com/XeNS1) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/check-no-game-data-v7-tar-20261125` --- ### 📝 Commits (1) - [`7dcca92`](https://github.com/ubiquitarianism/leonida/commit/7dcca92ce2865701c483711d0f151b34c3984c66) fix(check-no-game-data): inspect legacy V7 tar archives ### 📊 Changes **2 files changed** (+73 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `scripts/check_no_game_data.py` (+9 -2) 📝 `tests/test_check_no_game_data.py` (+64 -0) </details> ### 📄 Description Claimed in the coordination issue as: CHECK-NO-GAME-DATA-V7-TAR https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7166283601 Related: #1024 handles explicit-path validation in the same files; that separate behavior is unchanged here. ### What and why A valid V7 tar archive has no `ustar` marker. Saved under a harmless name such as `.bin`, it previously passed `check_no_game_data.py` without its members being inspected, even if a member started with a prohibited binary-format header. Recognize legacy archives by validating their first 512-byte header through `tarfile.TarInfo.frombuf`. The existing `ustar` detection still identifies damaged modern tar archives as unchecked. Member inspection continues through the existing depth, expanded-byte and member-count budgets. Add generated synthetic fixtures covering raw V7 tar, gzip/bzip2/xz compression, ZIP nesting, a clean first member followed by a synthetic DDS header, clean text-only archives, and non-archive controls. All binary fixture bytes are generated in temporary directories; no game files are included or needed. ### Tested Linux x86-64, Python 3.14.8, CPU only: - `python3 -I tests/test_check_no_game_data.py`: 15 tests passed. - `python3 -I tests/test_no_game_data_workflow.py`: 3 tests passed. - Regression proof: all five cases in the new V7 detection test fail against the unchanged scanner and pass with the fix. - `tests/test_text_write_line_endings.py`: 3 tests passed. - Full semantic suite: 489 files, 6,288 tests, zero failed files, 213 seconds with 2 workers. This was run before rebasing; the only subsequent upstream changes were `runtime/CMakeLists.txt` and `runtime/test/d3d12_title_va_test.cpp`, so the Python sources and semantic fixtures are identical. - `compileall` for `make_game.py`, `tools`, `tests` and the changed scanner; `make_game.py --help`; changed-file game-data scan; `git diff --check`: passed. - Known baseline failure: `test_runner_calls_all_tests.py` reports the uncalled `test_feature_scan.py::test_out_named_like_the_optional_spirv_index`. The same failure was reproduced on a separate clean upstream worktree. Neither file is changed here. GPUs tested: n/a; CPU-only checks. No game installation was accessed. AI-assisted: yes, OpenAI Codex. ### Checklist - [x] Rebased on current `main` without conflicts. - [x] One topic. - [x] No game data, keys, decryption or game-derived logs in the change or report. - [x] No translator rule changed; contract-table update is not applicable. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1910
No description provided.