summaryrefslogtreecommitdiff
path: root/nix/libstore/local-store.cc
diff options
context:
space:
mode:
Diffstat (limited to 'nix/libstore/local-store.cc')
-rw-r--r--nix/libstore/local-store.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/nix/libstore/local-store.cc b/nix/libstore/local-store.cc
index b8308b1aae5..478f2ccc44f 100644
--- a/nix/libstore/local-store.cc
+++ b/nix/libstore/local-store.cc
@@ -1340,12 +1340,16 @@ Path LocalStore::importPath(bool requireSignature, Source & source)
1340 if (magic != EXPORT_MAGIC) 1340 if (magic != EXPORT_MAGIC)
1341 throw Error("normalized archive cannot be imported; wrong format"); 1341 throw Error("normalized archive cannot be imported; wrong format");
1342 1342
1343 Path dstPath = readStorePath(hashAndReadSource); 1343 /* The path being imported must at least be syntactically valid. This
1344 * doesn't guarantee that it can be constructed by some existing method,
1345 * but it at least rules out paths like "/gnu/store/nix-12982-1" or
1346 * "/gnu/store/." or "/gnu/store/..". */
1347 Path dstPath = readStorePathStrict(hashAndReadSource);
1344 1348
1345 PathSet references = readStorePaths<PathSet>(hashAndReadSource); 1349 PathSet references = readStorePathsStrict<PathSet>(hashAndReadSource);
1346 1350
1347 Path deriver = readString(hashAndReadSource); 1351 Path deriver = readString(hashAndReadSource);
1348 if (deriver != "") assertStorePath(deriver); 1352 if (deriver != "") assertStorePathStrict(deriver);
1349 1353
1350 Hash hash = hashAndReadSource.hashSink.finish().first; 1354 Hash hash = hashAndReadSource.hashSink.finish().first;
1351 hashAndReadSource.hashing = false; 1355 hashAndReadSource.hashing = false;