1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-12 13:36:02 +01:00

Restore isAllowed check in ChrootLinuxDerivationBuilder

This early return was lost in d4ef822add.

By doing some
https://en.wikipedia.org/wiki/Non-virtual_interface_pattern, we can
ensure that we don't make this mistake again --- implementations are no
longer responsible for implementing the caching/memoization mechanism.
This commit is contained in:
Sergei Zimmerman 2025-11-10 21:12:07 +03:00 committed by John Ericson
parent a786c9eedb
commit 496e43ec72
3 changed files with 21 additions and 7 deletions

View file

@ -709,8 +709,11 @@ struct ChrootLinuxDerivationBuilder : ChrootDerivationBuilder, LinuxDerivationBu
DerivationBuilderImpl::killSandbox(getStats);
}
void addDependency(const StorePath & path) override
void addDependencyImpl(const StorePath & path) override
{
if (isAllowed(path))
return;
auto [source, target] = ChrootDerivationBuilder::addDependencyPrep(path);
/* Bind-mount the path into the sandbox. This requires