HLE: avoid following links during storage quota scans #1506
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1506
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1506/head"
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?
@Calvix2k on GitHub · 2026-11-24 18:35 UTC · original
Calvix2k:codex/storage-ignore-links-040→main· +43 −11 · 1 files · 1 commits · closed without mergingSummary
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.
@acetonahard-code on GitHub · 2026-11-24 22:32 UTC · original
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.
@Marvisak on GitHub · 2026-11-25 00:41 UTC · original
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.
@Calvix2k on GitHub · 2026-11-25 00:52 UTC · original
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