Repository navigation
Conversation
…dev#2945) Windows DeleteFileW fails with ERROR_ACCESS_DENIED on a file that has FILE_ATTRIBUTE_READONLY. The VFS returned success instead: for a game original it added a whiteout without checking the attribute, and for an overlay file std::fs::remove_file deletes read-only files on Windows. delete_file now checks the attribute on both the overlay and the original. The cross-volume move path removes its source through remove_moved_file, which skips the check, because MoveFileW moves read-only files. Fixes xcl-dev#2945 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent Windows VFS test Windows 11 25H2 (26200.9711), NTFS, Ryzen 9 5980HX, Radeon RX 6800M (driver 30.0.13002.13003), Rust 1.99.0 x64 MSVC, debug test profile. Tested
I also ran the same temporary test-only fixture against both revisions with
Not tested Physical cross-volume move, retail-title smoke, or GPU/full workspace suite. The supplementary fixture called the move hook helper directly. AI use OpenAI Codex (GPT-6.2 Sol) wrote and ran the temporary diagnostic and drafted this report. |
…ia remove_moved_file Port upstream 5f18eff (xcl-dev#2945): Vfs::delete_file splits into remove_file_entry(rel, ignore_readonly); delete checks readonly on overlay AND original, move path uses remove_moved_file (skips check, matching MoveFileW). Linux adaptation keeps clean_rel containment + checked_overlay_path + write_lock + whiteout helper (check_readonly = !ignore_readonly); vfs_hooks.rs move path + kernelx_linux.rs both move retire paths switched; vfs_hooks_linux move-policy test updated. Failing-first: new vfs::tests::delete_file_refuses_readonly_but_move_ still_retires failed pre-fix in worktree (overlay-readonly delete returned Ok, expected ACCESS_DENIED); passes post-fix. Linux DeleteFile entry was already correct via vfs_hooks_linux::delete_file — this closes the Vfs::delete_file retire primitive the move paths use. Gates: check -p xcl --tests pass; check --workspace pass; lib 821/0/1; launcher_e2e 5 passed 2 failed — identical on clean-tip stash (pre-existing message-string + shader-pack failures, unrelated); retail fresh-root exit 139 HOLDS at exe+0x2237320, 20 stubs (no-regress).
|
No other open PR fixes #2945. #2809 made a similar change and is closed. On main, AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
Windows DeleteFileW fails with ERROR_ACCESS_DENIED on a file that has FILE_ATTRIBUTE_READONLY. The VFS returned success instead: for a game original it added a whiteout without checking the attribute, and for an overlay file std::fs::remove_file deletes read-only files on Windows.
delete_file now checks the attribute on both the overlay and the original. The cross-volume move path removes its source through remove_moved_file, which skips the check, because MoveFileW moves read-only files.
Fixes #2945
What is in it
crates/xcl/src/vfs.rs:delete_fileand the newremove_moved_fileshareremove_file_entry.delete_filereturns ERROR_ACCESS_DENIED for a read-only overlay file or original, with no whiteout and no change on disk.remove_moved_fileskips the check.crates/xcl/src/vfs_hooks.rs: the copy-and-remove fallback ofmove_file_vfsremoves its source withremove_moved_file.vfs::tests::delete_file_respects_readonly_attribute: a nativeDeleteFileWcontrol, a read-only original and a read-only overlay file refused and kept, a move that still removes a read-only source, and a writable file that is still deleted.Tested
cargo test --workspace -- --test-threads=4: passed, failed, ignored (SKIPPED: <list, or none>)cargo test --locked -j 1 -p xcl --lib vfs -- --test-threads=1: 23 passed on 5f18eff, 22 passed on main 83b0081, 0 failed, 0 ignored. Their temporary fixture showed both read-only deletions report success and whiteout on main, and return ERROR_ACCESS_DENIED on this PR, with moves unchanged.Regression run
main:
<xcl-smoke block from a commit of main, pasted as printed>
PR:
<xcl-smoke block from 5f18eff, pasted as printed>
Not tested
AI use