xtask/policy: detect game/shader magics, non-UTF-8 binaries, and symlinks #492
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/492"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from fxceless/victory-fork. Originally posted by IlyassRS3 on 2026-11-25T01:33:28Z.
Summary
Tightens static Rule #1 enforcement in
xtask/src/policy.rs(cargo xtask policy):RPF7/RPF8/RPF9(RAGE packfiles),SGD5(engine shader archives),RSC7/RSC8(RAGE resources),FSSM(Xbox shader binaries),BKHD(Wwise soundbanks),OggS(Ogg audio),ELF(ELF binaries), and#(SPIR-V binaries) toFORBIDDEN_MAGIC.check()only testedcontent.contains(&0), letting raw non-UTF-8 binary content without0x00bytes pass if given an allowlisted extension such as.txt. Non-UTF-8 content is now explicitly rejected (all 169 existing repository files except the documentedbcpack-tables.binexception are valid UTF-8).WalkDirfiltered out symlinks (is_file()only) andrun()silently ignored anystd::fs::readerror (Err(_) => continue).run()now flags symlinks as policy violations and reports read/metadata errors on existing files (while still skipping deleted tracked files onNotFoundand directory/submodule entries).Verification
1.98.1, no Windows GPU / no game files.cargo test --locked -p xtask: 6 passed, 0 failed (includingrepository_passes_policyand 2 new tests:rejects_game_archive_magics_and_non_utf8_binary_without_nuls,rejects_symlinks_in_tree).cargo clippy --locked -p xtask --all-targets -- -D warnings: 0 warnings.cargo clippy --locked -p xtask --all-targets --target x86_64-pc-windows-msvc -- -D warningsand--all-features: 0 warnings.upstream/main(a803c87): both new tests fail on unpatchedxtask/src/policy.rs(4 passed; 2 failed).Imported from fxceless/victory-fork. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T01:33:45Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.