about summary refs log tree commit diff
path: root/src/libstore/store-api.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-07-12T12·01+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-07-12T12·03+0200
commitaeb810b01e17d040f9592681ee271f15874dce50 (patch)
treefbf5e93aeb43f6b900f4c813ea5655385b041bdf /src/libstore/store-api.cc
parent25a00cae5bf702b9e844b05923a9c59de9df6788 (diff)
Garbage collector: Don't follow symlinks arbitrarily
Only indirect roots (symlinks to symlinks to the Nix store) are now
supported.
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r--src/libstore/store-api.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index 32aaca6be0ea..0f250a3c7c04 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -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);
 }