Files: .. on a virtual drive stops at its root in short paths too (G:\..\x left the package folder) #258
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!258
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-258"
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?
@sharan104 on GitHub · 2026-11-26 13:32 UTC · original
sharan104:fix/files-audit→main· +59 −1 · 1 files · 1 commits · openA virtual drive's root is the root of a drive to the title, so
X:\..isX:\again.translate()already handles this for long paths: anything of 248 characters or more goes throughverbatim(), which stops..at the root. But a short path was joined to the host folder as it came, and the host's own clean-up then climbed above that folder. So:G:\..\xopenedxbeside the package folder instead ofG:\x...from the persistent-storage drive reached the data directory around the title's storage folder.This affects every title path call that goes through
translate():CreateFileW,fopen,GetFileAttributesWand the rest.Fix: a short path now drops each
..that would climb above the root (within_root) before the host sees it. Everything else is still left to the host's clean-up, as before.\\?\paths, which the host doesn't clean up, are unchanged.Only an exact
..component climbs. I checkedGetFullPathNameWon Windows 11:..,...,.. .and..are kept as literal names, or trimmed when they're the last part, and none of them goes up a level. So matching exactly..covers every spelling that climbs.Test:
dot_dot_stays_on_the_drivechecks the rewritten strings. It also checks realGetFileAttributesWcalls against a mounted temp folder:X:\..\outside.txtis not found, whileX:\..\inside.txtandX:/a/../../inside.txtare found. It fails before the change, where the host path keepsinner\..\a, and passes after it.Results:
cargo test -p victory-hle --locked: 156 passed, 0 failed, 2 ignored. The new test passed 10 out of 10 runs.cargo clippy -p victory-hle --all-targets --locked --no-deps -- -D warningsis clean, with and without--all-features.🤖 Generated with Claude Code
..on a virtual drive stops at its root, in short paths too eee51ba803View 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.