Allow relative paths anywhere into the parent's store path
This commit is contained in:
parent
5cbb9c5406
commit
06557299b3
|
@ -95,8 +95,11 @@ struct PathInputScheme : InputScheme
|
||||||
absPath = nix::absPath(path, parent);
|
absPath = nix::absPath(path, parent);
|
||||||
|
|
||||||
// for security, ensure that if the parent is a store path, it's inside it
|
// for security, ensure that if the parent is a store path, it's inside it
|
||||||
if (store->isInStore(parent) && !isInDir(absPath, parent))
|
if (store->isInStore(parent)) {
|
||||||
throw BadStorePath("relative path '%s' [%s] points outside of its parent's store path '%s'", path, absPath, parent);
|
auto storePath = store->printStorePath(store->toStorePath(parent).first);
|
||||||
|
if (!isInDir(absPath, storePath))
|
||||||
|
throw BadStorePath("relative path '%s' points outside of its parent's store path '%s'", path, storePath);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
absPath = path;
|
absPath = path;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue