HLE: avoid following links during storage quota scans #1505
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1506"
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 Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-24T18:35:19Z.
Summary
Fixes
VIC-BT-040from audit issue #1249.used_bytespreviously calledDirEntry::metadata(), which follows directory symlinks and junctions. A link back into the tree could recurse indefinitely, and an external link could make the title's quota scan count data outside its storage directory.The scan now uses an explicit pending-directory stack, checks entry types without following links, skips symlinks, and counts regular files. A regression test creates a nested self-referential directory link and verifies the scan terminates while still counting nested file contents.
Verification
cargo test -p victory-hle --lib --locked(95 passed)cargo clippy -p victory-hle --all-targets --all-features --locked -- -D warningsrustfmt --check --edition 2024 crates/victory-hle/src/modules/storage.rscargo xtask policy --stagedgit diff --checkTested on Windows 10. The regression test successfully created the directory symlink in this environment; no game data was used.
Imported from Marvisak/VIctory. Originally posted by acetonahard-code on 2026-11-24T22:32:23Z.
Tested on Windows 11 with the repo toolchain, merged into current
main(70564ae):cargo test -p victory-hlemainmain+ this PRcargo clippy --all-targets -- -D warnings, with and without--all-features: clean.I didn't test with game data.
Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:41:50Z.
Automated triage for the maintainers. Closing because by our reading the change is incorrect or would break something that works today.
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T00:52:08Z.
Before I rework this: could you say which case the triage considered incorrect? I see two candidates and would fix the right one rather than guess:
If the intended semantic is "count the title's own files, never traverse out of the storage root", I can implement exactly that with reparse-point detection and a test for a junction as well as a symlink. No reopen until that is agreed.
Pull request closed