Policy: a path with .. below a directory not yet created resolves #252
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!252
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/252/head"
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?
@SkippySteve on GitHub · 2026-11-24 01:50 UTC · original
SkippySteve/policy-dotdot-missing→main· +23 −3 · 1 files · 1 commits · closed without mergingensure_outside_reporesolves a destination that does not exist yet by walking up to its longest existing prefix, canonicalizing that, and re-appending the rest. The walk takes each component withPath::file_name, which isNonefor a path ending in... So a destination with..below a directory that is not created yet, such as<tmp>/missing/../cache, fails withinstead of being checked. A cache or data directory configured that way is refused even though it is outside the repository (
Cache::open, the config'ssubdir, andvictory configreport it as an error).The fix takes the last component with
components().next_back()and accepts both normal names and..; the tail is already normalized lexically afterwards, somissing/../cachebecomescacheunder the canonical prefix. Root and prefix components still end the walk with the same error as before.The new test
resolves_dotdot_after_a_missing_directorychecks that<tmp>/missing/../cacheis accepted and that<repo>/not-yet-created/../outis reported asInsideRepo(it was anIoerror before). It fails onmainand passes with the fix.cargo test -p victory-coreandcargo clippy -p victory-core --all-targetspass (on Linux).config.rsis not touched.@SkippySteve on GitHub · 2026-11-24 02:28 UTC · original
Superseded by #246, which now includes this change (rebased onto main, with its test).
Pull request closed