Loader: a bare title file name left the package drive empty; the package mount is now read-only #1104
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1107"
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 fxceless/victory-fork. Originally posted by FordMustang0288 on 2026-11-25T19:37:35Z.
What
Two host-side fixes for running the title from a package directory, and a guard that stops a title write from reaching the user's own game files.
1. A title started by bare file name lost its package root.
run.rstook the package root asA caller that starts the title by file name with the working directory set to the package root — the natural invocation, and what a launcher does after
cd— getsSome("")fromparent(), neverNone. The fallback never ran, the root was an empty path, and the log showed it plainly:The
G:mount then had nothing behind it.2. A path with no drive of its own did not mean the package.
The title asks for a container at the package root by a path with no drive and no directory of its own (its name appears in the linked upstream reports). With an empty package drive that resolved against the host's current drive (
Z:under Wine, i.e. the Linux root):path="\\<container>" result=0xffffffff succeeded=false last_error=2(ERROR_FILE_NOT_FOUND).The mount result stayed zero and the title asserted at its own
+0x2237178.An empty parent now means the working directory, and the package is mounted through
mount_package, which marks the drive read-only and makes it the title's current drive — after theT:mount, so it is the one left in force.3. The read-only flag is enforced, not just recorded.
DRIVEScarries a read-only bool;resolve_drivereturns it with the resolved path;translatekeeps its old behaviour for read-only callers, so reads of the package are unaffected. Mutating bindings refuse a write that lands on the mount withERROR_ACCESS_DENIED:DeleteFileW/A,RemoveDirectoryW,SetFileAttributesW,CreateDirectoryW, and either side ofMoveFileExW. TheCreateFilefamily refuses only on write intent (GENERIC_WRITE,GENERIC_ALL,FILE_WRITE_DATA,FILE_APPEND_DATA,FILE_WRITE_EA,FILE_WRITE_ATTRIBUTES,DELETE,WRITE_DAC,WRITE_OWNER), so a read or query mask still succeeds.This matters because on hosts that hand the title the user's own files — hardlinks, or the extracted package itself — a write through the package drive silently corrupts input the user owns. Refusing is better than rewriting: the console's package is read-only too, and a title that writes has its
T:drive.The doc comments on
mount_package,translate,resolve_driveandhas_write_intentdescribe what the code now does, including that reads are unaffected.Why this is worth reviewing separately from existing reports
The same assert at
+0x2237178is documented in Marvisak/VIctory#8, xcl-dev/xcl#301 and #945, and all three attribute it to the archive set: an archive absent, held open by another process, or right-sized with wrong contents. That advice is sound but was not the cause here — all 22 archives were present, the set matched the canonical public inventory exactly, and every archive began with validRPF9magic. The cause was the empty package root above, which also explains a second symptom nobody had connected to it: the title probing a host path for one of its own DLLs, because with no package drive there was nowhere for a root-relative path to land.Verified here
Windows GNU cross-build, run under Wine with Proton's vkd3d-proton and Microsoft's
dxil.dll. Before/after on the same machine and the same staged package:result=0xffffffff succeeded=false last_error=2succeeded=true last_error=0file opened path="G:\\<container>"0x80000003about 3 s invictory-hlecrate tests (Windows target under Wine)The one crate-test failure is
modules::net::tests::only_loopback_is_reachable, which asserts that the host'sws2_32.dllexports every function this layer overrides; Wine's does not exportWSAConnectByList, real Windows does. The patched files do not touchnet.rs.Not claimed: this does not make the title playable. It renders menus and reaches the world at 0.1 fps on the first run with four compute programs refused at pipeline creation — separate issues, filed separately.
Limits of the guard worth stating
The CRT and C++ mutators (
_wfopen,_wfsopen,fopen,_open,fiopen,remove,_wchmod,_wutime64) are not covered, so a title writing through one of those to a package path would still reach the host file. This is an improvement, not a sandbox.View 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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.