leonida_mods: reject pack outputs aliasing source files (MODS-PACK-OUTPUT-ALIAS) #1057

Merged
Taffyyy-ops merged 1 commit from upstream-pr/1057 into main 2026-11-24 23:22:04 +00:00
Taffyyy-ops commented 2026-11-24 17:25:53 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Taffyyy-ops on 2026-11-24T17:25:53Z.


Automated PR from local workspace. Synthetic tests + check_no_game_data.py passed. AI-assisted: yes.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5477070879 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1057). Originally posted by [Taffyyy-ops](https://github.com/Taffyyy-ops) on 2026-11-24T17:25:53Z. --- Automated PR from local workspace. Synthetic tests + check_no_game_data.py passed. AI-assisted: yes.
KernelSmoker commented 2026-11-24 17:36:58 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KernelSmoker on 2026-11-24T17:36:58Z.

Review: APPROVED


The packer now enumerates source files and rejects output paths that resolve to a source file before opening/truncating the archive. This covers direct aliases, existing symlink/case-folding aliases through the shared report-path helper, and hard links where supported; the tests also assert source and output bytes remain intact after refusal. Validation on head 2277b2d76e: new alias suite 3/3, shared report-path suite 22/22, existing mod suite 10/10; no-game-data and diff checks passed, and merge-tree onto current main is clean. Synthetic files only; no game data or GPU run.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6044308950 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1057#pullrequestreview-6044308950). Originally posted by [KernelSmoker](https://github.com/KernelSmoker) on 2026-11-24T17:36:58Z. **Review:** APPROVED --- The packer now enumerates source files and rejects output paths that resolve to a source file before opening/truncating the archive. This covers direct aliases, existing symlink/case-folding aliases through the shared report-path helper, and hard links where supported; the tests also assert source and output bytes remain intact after refusal. Validation on head 2277b2d76e2ecc63fa8f838f8164a20fad86ea6f: new alias suite 3/3, shared report-path suite 22/22, existing mod suite 10/10; no-game-data and diff checks passed, and merge-tree onto current main is clean. Synthetic files only; no game data or GPU run.
QemmHD commented 2026-11-24 23:22:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-24T23:22:02Z.


Merging.

Why merged: MODS-PACK-OUTPUT-ALIAS: leonida_mods pack lists the files to pack and refuses an output that aliases one of them, before it opens or truncates the zip, so a pack can't destroy its own input. KernelSmoker approved it.

Why it's good: 13 passed. The hard-link case really runs on NTFS here.

Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 0f98d193c. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests, ctest_registration) gives 578 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7147318319 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1057#issuecomment-7147318319). Originally posted by [QemmHD](https://github.com/QemmHD) on 2026-11-24T23:22:02Z. --- Merging. **Why merged:** MODS-PACK-OUTPUT-ALIAS: leonida_mods pack lists the files to pack and refuses an output that aliases one of them, before it opens or truncates the zip, so a pack can't destroy its own input. KernelSmoker approved it. **Why it's good:** 13 passed. The hard-link case really runs on NTFS here. Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 0f98d193c. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests, ctest_registration) gives 578 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
Taffyyy-ops commented 2026-11-25 12:46:36 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Taffyyy-ops on 2026-11-25T12:46:36Z.


Discord: rwaaar

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7162839860 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1057#issuecomment-7162839860). Originally posted by [Taffyyy-ops](https://github.com/Taffyyy-ops) on 2026-11-25T12:46:36Z. --- Discord: rwaaar
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!1057
No description provided.