fix(core): refuse a data_dir inside the cache_dir #224
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!224
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-224"
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?
@mutlusinan on GitHub · 2026-11-27 19:53 UTC · original
mutlusinan:fix/core-data-dir-guard→main· +48 −1 · 2 files · 1 commits · openProblem
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.@mutlusinan on GitHub · 2026-11-27 20:21 UTC · original
Risk assessment (porting review)
%LOCALAPPDATA%/victory/cacheand.../data), so no default installation is affected.victory.tomlor environment that putsdata_dirinsidecache_dirnow fails at startup with an explicit message instead of running (and losing saves whenever the cache is cleared). Intended, but it is a hard failure for those setups rather than a warning.is_withinresolves symlinks and..without requiring either path to exist; a sibling with a common prefix (cache-old) and a cache inside the data folder are still accepted (tests cover both).mainate69e39c.@1tsethan on GitHub · 2026-11-27 23:00 UTC · original
Independent Windows validation of PR #224.
Tested commit:
0f52dbd892f2e9af7a84e0edc9bec635ec42dc32.cargo test --locked -p victory-coreExit: 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.
@cloph-dsp on GitHub · 2026-11-27 23:49 UTC · original
Independent local verification of PR #224 (refuse a
data_direqual to or inside thecache_dir).cargo test --locked, synthetic inputs only.0f52dbd892f2e9af7a84e0edc9bec635ec42dc32, merge base0cef07e9d766df48f0e95f13ce3bbbe2290fe9d3, worktree-localCARGO_TARGET_DIR.cargo test --locked -p victory-core --lib -- config::tests::data_dir_inside_cache_dir_is_refused --exact --test-threads=1 --quiet→test result: ok. 1 passed; 0 failed; 15 filtered out, exit 0.cargo test --locked -p victory-core --lib -- config::tests --quiet→test result: ok. 11 passed; 0 failed; 5 filtered out, exit 0 (includes the sibling testsdata_dir_equal_to_cache_dir_is_refusedandsibling_with_similar_prefix_and_cache_inside_data_are_allowed).git grep -F data_dir_inside_cache_dir_is_refused 0cef07e9 -- crates/victory-core/src/config.rs→ exit 1 (test absent on base).git diff --check 0cef07e9 HEADclean; diff 2 files, +48/−1.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.
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.