copyStorePath(): Don't require signatures for "trusted" stores

For example, SSH stores could be trusted.
This commit is contained in:
Eelco Dolstra 2017-02-07 19:23:16 +01:00
parent fa07558a06
commit f38224e924
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
2 changed files with 13 additions and 0 deletions

View file

@ -529,6 +529,15 @@ void copyStorePath(ref<Store> srcStore, ref<Store> dstStore,
StringSink sink;
srcStore->narFromPath({storePath}, sink);
if (srcStore->isTrusted())
dontCheckSigs = true;
if (!info->narHash && dontCheckSigs) {
auto info2 = make_ref<ValidPathInfo>(*info);
info2->narHash = hashString(htSHA256, *sink.s);
info = info2;
}
dstStore->addToStore(*info, sink.s, repair, dontCheckSigs);
}

View file

@ -562,6 +562,10 @@ public:
const Stats & getStats();
/* Whether this store paths from this store can be imported even
if they lack a signature. */
virtual bool isTrusted() { return false; }
protected:
Stats stats;