config: reject a data_dir equal to or inside the cache_dir #42
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/uiliannn--VItoriaBr!42
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/42/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?
@LouisRiverstone on GitHub · 2026-11-25 20:14 UTC · original
LouisRiverstone:fix/data-dir-inside-cache→main· +48 −1 · 2 files · 1 commits · merged 2026-11-25 20:33 UTCCloses #38
Why
Config::resolveaccepted adata_direqual to or insidecache_dir. Clearing the cache would then wipe persistent title data.What changed
policy::is_within(path, root): compares resolved paths (symlinks,.., not-yet-existing tails) by whole components, reusing the existingresolve.Config::resolvebails whendata_diris withincache_dir.cache_dirinsidedata_dir) stays allowed: clearing the cache cannot touch the rest of the data.Verify
cargo test -p victory-core: 14 pass, including new cases for equal, nested,a/../data, siblingcache-old, and cache-inside-data. Clippy and fmt clean.Note: the author of #38 mentioned a local branch; happy to close this in favor of theirs if they prefer.
🤖 Generated with Claude Code
..in the not-yet-existing part of a path (port of VIctory#937) #53@Djei365 on GitHub · 2026-11-25 20:33 UTC · original
Fala, Louis! Obrigado pela contribuição e pela consideração em relação à minha branch.
Eu também já implementei uma solução local para a issue #38, atualmente com 19 testes passando, incluindo cenários de caminhos relativos, diretórios inexistentes, diferenças de capitalização no Windows, Unicode e junctions.
Estou finalizando uma revisão independente da implementação para evitar regressões na política existente de proteção do repositório.
Acho que podemos alinhar nossas abordagens e aproveitar os pontos positivos de ambas as implementações, evitando trabalho duplicado.
Não precisa fechar seu PR por enquanto. Podemos aguardar também a orientação dos mantenedores sobre qual abordagem seguir.