about summary refs log tree commit diff
path: root/src/libutil/util.cc
diff options
context:
space:
mode:
authorJude Taylor <me@jude.bio>2015-09-29T16·03-0700
committerJude Taylor <me@jude.bio>2015-10-21T19·38-0700
commite770f941d612922a19fae0dd7552a47a64751c42 (patch)
tree6c0370484f15e38683822279b4849f50094e67a0 /src/libutil/util.cc
parent6dbc9e02ecc649f6739dac3a87381223e96f5e75 (diff)
make sandbox builds more permissive
Diffstat (limited to 'src/libutil/util.cc')
-rw-r--r--src/libutil/util.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 11c75d2cda4c..178f78bde6da 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -167,10 +167,11 @@ string baseNameOf(const Path & path)
 
 bool isInDir(const Path & path, const Path & dir)
 {
-    return path[0] == '/'
-        && string(path, 0, dir.size()) == dir
-        && path.size() >= dir.size() + 2
-        && path[dir.size()] == '/';
+    return dir == "/"
+        || (path[0] == '/'
+            && string(path, 0, dir.size()) == dir
+            && path.size() >= dir.size() + 2
+            && path[dir.size()] == '/');
 }