copyStorePath(): Don't require signatures for "trusted" stores
For example, SSH stores could be trusted.
This commit is contained in:
parent
fa07558a06
commit
f38224e924
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue