aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-07-07 14:25:43 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-07-07 14:25:43 +0200
commit7c9ece5dcaf6407449616c9d2d302853829c4f7d (patch)
tree3b2cad9587fa4f127839bc371dcee304978dc4f9 /src/libstore/build.cc
parentc385535c18ec2bd73b60e19bcfeb3c07487010fd (diff)
exportReferencesGraph: Fix support for non-top-level store paths
Fixes #3471.
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 347fe1b99..0ef2f288f 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -2041,7 +2041,10 @@ void DerivationGoal::startBuilder()
if (!std::regex_match(fileName, regex))
throw Error("invalid file name '%s' in 'exportReferencesGraph'", fileName);
- auto storePath = worker.store.parseStorePath(*i++);
+ auto storePathS = *i++;
+ if (!worker.store.isInStore(storePathS))
+ throw BuildError("'exportReferencesGraph' contains a non-store path '%1%'", storePathS);
+ auto storePath = worker.store.parseStorePath(worker.store.toStorePath(storePathS));
/* Write closure info to <fileName>. */
writeFile(tmpDir + "/" + fileName,