Repository navigation
fix(core): refuse a data_dir inside the cache_dir - #224
mutlusinan wants to merge 1 commit into
Conversation
…coder#38, trustno1-coder#42) The cache may be deleted at any time; saves and settings kept inside it would go with it. `is_within` compares resolved whole components, so a sibling such as `cache-old` is still accepted, and a cache inside the data folder remains allowed. Ported from uiliannn/VItoriaBr 30d9ba1 (pull requests trustno1-coder#38 and trustno1-coder#42).
Risk assessment (porting review)
|
|
Independent Windows validation of PR #224. Tested commit:
Exit: 0.
Independent verification with OpenAI Codex assistance. Windows 11 Pro build 26200; Rust 1.98.1 MSVC; Windows SDK libraries from Microsoft.Windows.SDK.CPP.x64 10.0.28000.2957. Test harness used an RTX 3070 Ti / AMD integrated-GPU host; adapter identity was not captured for every test. These are focused checks on the stated PR commit, not gameplay, FPS, or a merged-main integration result. |
|
Independent local verification of PR #224 (refuse a
No full workspace suite or clippy locally. GPU/driver N/A (CPU-only config validation). AI-assisted (Hy4 flash). No game data, assets, extracted shaders, DRM or decrypt. |
|
Merged into main (8fc2254) and shipped in v2026.11.27.10. The commit keeps you as its author, so it counts toward the contributors list. GitHub shows this as closed rather than merged only because the commits were applied on top of the newest main (new commit IDs). Thank you! |
Problem
data_dircould be set to thecache_diror to a folder inside it. The cache may be deleted at any time, so saves and settings kept there would go with it, silently.Fix
Config::resolverefuses adata_dirthat is thecache_diror lies inside it.victory_core::policy::is_withincompares resolved whole path components (after symlinks and.., neither path needing to exist), so a sibling such ascache-oldis still accepted, and a cache inside the data folder stays allowed.Verification
cargo test -p victory-core— 16 passed, 0 failed, includingdata_dir_equal_to_cache_dir_is_refused,data_dir_inside_cache_dir_is_refusedandsibling_with_similar_prefix_and_cache_inside_data_are_allowed.cargo check --workspace --target x86_64-pc-windows-msvc --locked— clean.Ported from uiliannn/VItoriaBr
30d9ba1(pull requests #38 and #42), GPL-3.0.