VFS: a game folder on a network share is not protected from writes (follow-up to #579) #955
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 ivall/xcl. Originally posted by Conrage on 2026-11-24T09:35:35Z.
Vfs::classify_withreturnsTarget::Passfor every path starting with\\before it compares the path with the game root:github.com/ivall/xcl@077ce40/crates/xcl/src/vfs.rs (L270-L272)When the game root is itself a UNC path (
\\server\share\Game), a title that opens a file by its absolute path (for example one built fromGetModuleFileNameW) bypasses the overlay and writes into the game folder. Console paths (D:\x,GAME:\x) are not affected because mounts are applied after this check and the result is compared with the game root.Today the launcher can't start such a game (it turns
\\?\UNC\…into a relativeUNC\…), but #579 fixes that. Once #579 merges, this breaks "the game folder is never modified". #316 adds tests asserting that UNC paths pass through, but doesn't cover a UNC game root.Expected:
classify_with(r"\\srv\share\Game\save.dat", …)with game root\\srv\share\GamereturnsTarget::Game { rel: "save.dat" }, as it does for a local root.Actual (from reading the code):
Target::Pass.Suggested fix: compare with the game root and XCL's own folders before the UNC early return, and let only UNC paths outside them pass. A unit test can inject
fullthe way the existingvfs.rstests do, so no share is needed.Not tested: found by reading the code; not run (no Windows machine).
AI use: found, checked and written up by Claude Code (Claude Opus 5.5) at my request.
Imported from ivall/xcl. Originally posted by chippy01 on 2026-11-24T10:06:26Z.
If nobody is taking this I'll try and work on this as my first PR for this project.
The main idea is: classify_with will compare a UNC path with the game root before letting it pass, so only paths outside the game folder on a share pass through (Unit test with an injected full_path, no network share needed)