Repository navigation
Conversation
Kam471
left a comment
There was a problem hiding this comment.
Reviewed 9c34326 (MSVC 19.44.35228, Ninja, RelWithDebInfo, Windows 11).
- Built
file_system_testfromruntime/and ran it ->1639 check(s), 0 failure(s), exit 0. CTest-R file_systempasses 1/1. - Negative control: with
runtime/shims/file_system.cpprestored toorigin/main, the same binary ->1639 check(s), 248 failure(s), exit 1, so the new cases do exercise the guard (matches the PR's number). Source restored afterwards. check_self_copiescompares the shim's result and error against the realCopyFileW/A,CopyFileExW/AandCopyFile2over 8 source states x 4 flag sets x overlay/no-overlay x alias/exact name, and checks package/overlay bytes, no overlay parent, no progress callbacks, plus the host self-copy path.python -I -m pytest tests/test_docs_links.py -q-> 6 passed;tests/test_text_encoding.py-> 2 passed.git diff --checkclean.
Merge order depends on #5234, #5187 and #3655 as stated; the guard itself applies and passes standalone at 3faac557 + this commit.
Verdict: OK to merge once the dependencies land.
|
Review-only check against main 3faac55: the C++ test needs cmake/Windows and was not built here. The guard logic reads right — it fires only for two pure-console logical paths so host self-copies keep native behavior, it sits after source-open errors with the documented precedence (FIE, then read-only, then sharing), the test target is already registered in runtime/CMakeLists.txt, and docs/runtime_imports.md was updated to match. Python-side guards pass: test_exe_checklist, test_docs_repo_paths, test_docs_list_items all OK. The branch reports no CI checks — the windows job is the real check for this one and it is not running. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only review). |
|
Tested 9c34326 on Intel UHD Graphics 770, driver 32.0.101.7088: file_system_test.exe exits 0 with "1639 check(s), 0 failure(s)" and ctest -R file_system passes. The log has "PASS CopyFileW self-copy: ordinary, flags=0, overlay=0, alias=1", "PASS self-copy rejected before copying sends no progress callback" and "PASS self-copy read-only fixture". The 384-case native and shim matrix, the run on main, and a build combined with the PRs this one depends on were not run. AI-assisted. |
9c34326 to
6178a41
Compare
|
Rebased onto Standalone file_system CTest: 1,740 checks, zero failures. The separate integration with refreshed #5187 ( Documentation links, text encoding and diff checks pass. Root source/range review is clear. #5187 and #5234 remain integration dependencies; #3655 is now in main. This remains native Windows coverage; Wine was not run. All fixtures and overlays are synthetic. No game files accessed or GPU used. AI-assisted: yes. |
|
Tested 6178a41 on NVIDIA GeForce RTX 4080, driver 617.42: file_system_test exits 0 with "1738 check(s), 0 failure(s)". The log has "PASS self-copy rejected before copying sends no progress callback", "PASS CopyFile2 self-copy: deleted, flags=5, overlay=0, alias=1", "PASS a distinct destination still copies the visible source into the overlay" and "PASS a host self-copy preserves native errors, callbacks, and bytes". The description's standalone count is 1,740. AI-assisted. |
|
Tested 6178a41 merged with main 561b65a on Windows (native, MSVC 14.51 / VS 18, Ninja, RelWithDebInfo, built from a
Negative control: |
larpinguser
left a comment
There was a problem hiding this comment.
Summary: runtime/shims/file_system.cpp adds same_console_path and self_copy_error so copy APIs reject equal logical console paths (aliases, case, ./..) before creating overlays or parents, with source-open, fail-if-exists, read-only, then sharing error precedence. Tests exercise CopyFileW/A/ExW/ExA/CopyFile2 states and flags; docs record the behavior.
Why merge: It prevents self-copies from mutating package or overlay state and preserves native-style diagnostics.
Verdict: Approve
|
Summary: Why merge: It prevents self-copies from mutating package or overlay state and preserves native-style diagnostics. Verdict: Approve |
6178a41 to
f1a79ce
Compare
|
Refreshed onto main Current native Windows results: 1,914 standalone filesystem checks; 2,167 in the separate exact #5234 Synthetic data only, no game files or GPU. AI-assisted: yes. |
Problem
Copying a package-only console file to its own logical name succeeds because the source and overlay destination are different host files. The title gets a false success and an unwanted overlay. Native Windows rejects the self-copy. A locked self-copy with
FAIL_IF_EXISTSalso reports the wrong error.Change
RT-406 adds a shared guard before any destination preparation or writable-source copy-up. It compares normalized console components using the existing parser and case comparison, then probes the visible source read-only to preserve native source-error precedence. All five CopyFile routes reject equal logical names without creating an overlay file or parent. Existing overlay contents stay intact, and distinct/host copies retain their behavior.
The scope is equal logical console paths, including
GAME:/G:aliases, case, separators, and dot/parent normalization. It does not add general failed-copy rollback or physical hard-link detection. CopyFile2 early errors retain the existing policy of returning an HRESULT without synthesizing progress error messages; native Windows may issue such a message.Depends on: #5234
Depends on: #5187
The original integration used upstream
3faac557and combined dependencies separately at exact heads29dc0a03,97278af44, andcc48f055. #5234 has shared code/test/doc hunks; #5187 has a test insertion conflict. Resolutions preserve both changes and place the guard before source copy-up.Current upstream validation
Rebased onto
1cc6e3c121969761d9dad8fdec99f19928213973atf1a79cec1beb2ce2a083641f8c8de9003f4b5e7f. The production and documentation delta is unchanged from the preceding published head. The test rebase preserves main's DACL restoration, native case-rename probe, exception boundary and cleanup, and runs the self-copy checks inside that boundary. Main's CopyFile2 cancellation check is retained.On Windows 11 x64 with MSVC 19.44.35228 and Windows SDK 10.0.26100.0:
file_systemCTest: 1,914 checks, zero failures.8651615eedf0e154539ea2977a682f6ee766dc06and RT-389: Support console current directories and relative file paths #5187e43ed3e1e29bb8b5499d81c647b7821b40bbe9df: 2,167 filesystem checks, zero failures. The self-copy guard remains before writable-source preflight and copy-up.git diff --checkpass. Synthetic files only; no game data or GPU. Wine was not run.#5234 and #5187 remain integration dependencies. Their exact tested heads are recorded above; the current refresh does not claim a new run of the historical #5548 OEM matrix.
Earlier upstream validation
The following results belong to the preceding
6178a411head and are retained as historical evidence.Rebased onto
561b65a832218fbb9e6d2effd392a8eef093a3f8at6178a411b5bd49e6eb4011e160fb7a55e6dc38b9. The logical self-copy guard now uses upstream's equivalent component-wise same_entry helper. Source-error precedence, logical aliases, package/overlay preservation, host behavior and the early-error callback limitation are unchanged. The now-merged #3655 parameter/fallback checks are retained.Standalone file_system CTest: 1,740 checks, zero failures. The separate integration with refreshed #5187 (
e43ed3e1), #5234 (8651615e) and unchanged #5548 (d4fbd45c) retains the self-copy guard before writable-source preflight/copy-up. All 1,993 filesystem checks, 557 OEM checks, 63 native/63 mapped directory checks, 67 encoding/path integration checks and 64 relative self-copy cases (260 checks) pass.Documentation links, text encoding and diff checks pass. Root source/range review is clear. #5187 and #5234 remain integration dependencies; #3655 is now in main. This remains native Windows coverage; Wine was not run.
Original validation
Windows 11 x64, MSVC 19.44.35228, SDK 10.0.26100.0. Original synthetic files only; no game data or GPU work.
file_systempasses 1/1.git diff --checkpass. Independent source review found no actionable issue.Coordination: #5256 (comment)
AI-assisted: yes.