From 6a888ec29a6724f916f96508b3a94a86c643c18e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 8 Sep 2017 14:48:08 +0200 Subject: copyStorePath(): Fill in missing narHash regardless of checkSigs I don't remember what the reasoning was here, but security is provided by the signatures, not by whether the hash is provided by the other store. --- src/libstore/store-api.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/libstore/store-api.cc') diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 7a8a3f7dee04..fa6ade75002a 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -593,23 +593,19 @@ void copyStorePath(ref srcStore, ref dstStore, MyStringSink sink(progress); srcStore->narFromPath({storePath}, sink); - if (!info->narHash && !checkSigs) { + if (!info->narHash) { auto info2 = make_ref(*info); info2->narHash = hashString(htSHA256, *sink.s); if (!info->narSize) info2->narSize = sink.s->size(); info = info2; } - assert(info->narHash); - if (info->ultimate) { auto info2 = make_ref(*info); info2->ultimate = false; info = info2; } - assert(info->narHash); - dstStore->addToStore(*info, sink.s, repair, checkSigs); } -- cgit 1.4.1