HLE/files: a title path's ".." stops at the mounted drive's root #835
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!835
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-835"
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?
@CwWwWwW on GitHub · 2026-11-28 07:34 UTC · original
CwWwWwW:fix/mount-root-dot-clamp→main· +78 −0 · 1 files · 1 commits · merged 2026-11-29 08:16 UTCPorted to trustno1-coder/VIctory-NVIDIA from the same change submitted to fxceless/victory-fork as PR #1444 (head
719d8ee928, author CwWwWwW). The fork's own line was dropped when it rebased onto959dcaf(5dbf5ce), so this is submitted here directly. The description below is the original one; its 'Verification' numbers refer to the fork tree. Rebased onto main63b902f.Problem
The
victory-hlefilesmodule maps a host folder to a virtual drive and rewrites the title's path onto it (translate). For a short path the title's tail is appended to the mount's host folder unchanged, and the host's own path clean-up then resolves..against the host volume's root, not against the mount root. A title path with more..than its depth therefore leaves the folder the drive stands for:X:\..\..\save.binis written beside the mount instead of at its root, where the title will not find it again (and another folder of the host can be hit).The console clamps
..at the drive's root, and this layer's own\\?\branch for long paths (verbatim) already does that, so the short branch contradicted both.Fix
Resolve
.and..in the title's tail with the mount root as the floor, and only when the path names such a component: every other path keeps its exact form and the host's clean-up.X:andX:namestay relative to the root, a trailing separator is kept, and the\\?\-prefixed form gets the same treatment.Regression test
files::tests::dots_stop_at_the_mounted_rootmounts a temp folder as a drive and checks thatX:\a\..\..\b.txtresolves inside the mount, then writes throughX:\..\escaped.bin: with the old code the file is created beside the mount root (the test fails: left...\storage\a\..\..\b.txt) and with the change it stays in the folder.Verification
cargo test -p victory-hle --lib --locked: 104 passed, 0 failedcargo clippy -p victory-hle --all-targets --locked -- -D warnings: cleancrates/victory-hle/src/modules/files.rs(+78)Found and fixed independently in this tree; no external code was used.
The PR's Clippy check fails on main already: at 9a9091d
cargo clippy --workspace --all-targetsfails invictory-shader(wave64_after_loop.rs precedence, valu_tests.rs simplifiable/negated partial-ord comparisons); open PR #1440 fixes exactly those lints. This diff touches none of those files, and the touched crate's own tests and clippy are clean locally.Verification on this tree (base
63b902f, 2026-11-27)63b902ffailed on those before this change.@Dukestar69 on GitHub · 2026-11-28 07:49 UTC · original · approved these changes
Tested locally merged onto
main(63b902f).cargo xtask policypassed (294 files ok).cargo test -p victory-hle --lib filespassed (10 passed; 0 failed, including the newdots_stop_at_the_mounted_roottest) with 0 compiler warnings.Important path-normalization/containment fix ensuring
..segments cannot escape the mounted drive root. LGTM.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).