about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-02-24T15·38+0100
committerEelco Dolstra <edolstra@gmail.com>2017-02-24T15·38+0100
commit1c718f80d3e91c6dd8f1337f81b37e4837384c75 (patch)
tree64e0ba90abd0fc6412404ec8e0310d58fa702fa7
parent668fef2e4f1c7758e2a55e355b4826014d5b7ba9 (diff)
Verify content-addressability assertions at registration time
-rw-r--r--src/libstore/local-store.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index 9b775e16a387..bc63955af0e9 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -519,6 +519,8 @@ void LocalStore::checkDerivationOutputs(const Path & drvPath, const Derivation &
 uint64_t LocalStore::addValidPath(State & state,
     const ValidPathInfo & info, bool checkOutputs)
 {
+    assert(info.ca == "" || info.isContentAddressed(*this));
+
     state.stmtRegisterValidPath.use()
         (info.path)
         ("sha256:" + printHash(info.narHash))