mirror of
https://github.com/NixOS/nix
synced 2025-06-27 08:31:16 +02:00
copyStorePath(): Don't require signatures for "trusted" stores
For example, SSH stores could be trusted.
This commit is contained in:
parent
fa07558a06
commit
f38224e924
2 changed files with 13 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue