mirror of
https://github.com/NixOS/nix
synced 2025-07-03 02:01:48 +02:00
Coding style
This commit is contained in:
parent
c6b063c31a
commit
af94b54db3
3 changed files with 19 additions and 25 deletions
|
@ -85,8 +85,7 @@ struct PathInputScheme : InputScheme
|
|||
std::string absPath;
|
||||
auto path = getStrAttr(input.attrs, "path");
|
||||
|
||||
if (path[0] != '/' && input.parent)
|
||||
{
|
||||
if (path[0] != '/' && input.parent) {
|
||||
auto parent = canonPath(*input.parent);
|
||||
|
||||
// the path isn't relative, prefix it
|
||||
|
@ -95,11 +94,8 @@ struct PathInputScheme : InputScheme
|
|||
// for security, ensure that if the parent is a store path, it's inside it
|
||||
if (!parent.rfind(store->storeDir, 0) && absPath.rfind(store->storeDir, 0))
|
||||
throw BadStorePath("relative path '%s' points outside of its parent's store path %s, this is a security violation", path, parent);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else
|
||||
absPath = path;
|
||||
}
|
||||
|
||||
// FIXME: check whether access to 'path' is allowed.
|
||||
auto storePath = store->maybeParseStorePath(absPath);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue