config: reject a data_dir equal to or inside the cache_dir #42
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/42"
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?
Imported from uiliannn/VItoriaBr. Originally posted by LouisRiverstone on 2026-11-25T20:14:21Z.
Closes #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
Imported from uiliannn/VItoriaBr. Originally posted by Djei365 on 2026-11-25T20:33:51Z.
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.