Fix #1921
This commit is contained in:
parent
4fd28bee89
commit
d34fa2bcc3
3 changed files with 14 additions and 4 deletions
|
|
@ -53,7 +53,6 @@ LocalStore::LocalStore(const Params & params)
|
|||
, trashDir(realStoreDir + "/trash")
|
||||
, tempRootsDir(stateDir + "/temproots")
|
||||
, fnTempRoots(fmt("%s/%d", tempRootsDir, getpid()))
|
||||
, publicKeys(getDefaultPublicKeys())
|
||||
{
|
||||
auto state(_state.lock());
|
||||
|
||||
|
|
@ -964,12 +963,21 @@ void LocalStore::invalidatePath(State & state, const Path & path)
|
|||
}
|
||||
|
||||
|
||||
const PublicKeys & LocalStore::getPublicKeys()
|
||||
{
|
||||
auto state(_state.lock());
|
||||
if (!state->publicKeys)
|
||||
state->publicKeys = std::make_unique<PublicKeys>(getDefaultPublicKeys());
|
||||
return *state->publicKeys;
|
||||
}
|
||||
|
||||
|
||||
void LocalStore::addToStore(const ValidPathInfo & info, Source & source,
|
||||
RepairFlag repair, CheckSigsFlag checkSigs, std::shared_ptr<FSAccessor> accessor)
|
||||
{
|
||||
assert(info.narHash);
|
||||
|
||||
if (requireSigs && checkSigs && !info.checkSignatures(*this, publicKeys))
|
||||
if (requireSigs && checkSigs && !info.checkSignatures(*this, getPublicKeys()))
|
||||
throw Error("cannot add path '%s' because it lacks a valid signature", info.path);
|
||||
|
||||
addTempRoot(info.path);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue