diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-08-23 13:05:42 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2021-08-23 13:05:42 +0200 |
commit | af94b54db3a2be100731a215cb5e95f306471731 (patch) | |
tree | 9acc237829107e6f8aa33f45eead7f578391d7c6 /src/libfetchers | |
parent | c6b063c31a57b4e53f2e90787a31ed74a3164827 (diff) |
Coding style
Diffstat (limited to 'src/libfetchers')
-rw-r--r-- | src/libfetchers/path.cc | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/libfetchers/path.cc b/src/libfetchers/path.cc index c4977834d..b6fcdac9e 100644 --- a/src/libfetchers/path.cc +++ b/src/libfetchers/path.cc @@ -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); |