Verify content-addressability assertions at registration time

This commit is contained in:
Eelco Dolstra 2017-02-24 16:38:14 +01:00
parent 668fef2e4f
commit 1c718f80d3
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -519,6 +519,8 @@ void LocalStore::checkDerivationOutputs(const Path & drvPath, const Derivation &
uint64_t LocalStore::addValidPath(State & state, uint64_t LocalStore::addValidPath(State & state,
const ValidPathInfo & info, bool checkOutputs) const ValidPathInfo & info, bool checkOutputs)
{ {
assert(info.ca == "" || info.isContentAddressed(*this));
state.stmtRegisterValidPath.use() state.stmtRegisterValidPath.use()
(info.path) (info.path)
("sha256:" + printHash(info.narHash)) ("sha256:" + printHash(info.narHash))