mirror of
https://github.com/NixOS/nix
synced 2025-06-27 04:21:16 +02:00
Garbage collector: Don't follow symlinks arbitrarily
Only indirect roots (symlinks to symlinks to the Nix store) are now supported.
This commit is contained in:
parent
25a00cae5b
commit
aeb810b01e
5 changed files with 54 additions and 48 deletions
|
@ -18,10 +18,7 @@ GCOptions::GCOptions()
|
|||
|
||||
bool isInStore(const Path & path)
|
||||
{
|
||||
return path[0] == '/'
|
||||
&& string(path, 0, settings.nixStore.size()) == settings.nixStore
|
||||
&& path.size() >= settings.nixStore.size() + 2
|
||||
&& path[settings.nixStore.size()] == '/';
|
||||
return isInDir(path, settings.nixStore);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue