diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-09-08 14:48:08 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-09-08 14:48:08 +0200 |
commit | 6a888ec29a6724f916f96508b3a94a86c643c18e (patch) | |
tree | 20a033d255cfa0bbe1cabe0987991c1e92091ade /src/libstore/store-api.cc | |
parent | 3cf1705583ee64137cdebf8f4e50ccffdaf7c756 (diff) |
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.
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r-- | src/libstore/store-api.cc | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 7a8a3f7de..fa6ade750 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -593,23 +593,19 @@ void copyStorePath(ref<Store> srcStore, ref<Store> dstStore, MyStringSink sink(progress); srcStore->narFromPath({storePath}, sink); - if (!info->narHash && !checkSigs) { + if (!info->narHash) { auto info2 = make_ref<ValidPathInfo>(*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<ValidPathInfo>(*info); info2->ultimate = false; info = info2; } - assert(info->narHash); - dstStore->addToStore(*info, sink.s, repair, checkSigs); } |