From 1c718f80d3e91c6dd8f1337f81b37e4837384c75 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 24 Feb 2017 16:38:14 +0100 Subject: [PATCH] Verify content-addressability assertions at registration time --- src/libstore/local-store.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 9b775e16a..bc63955af 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))