mirror of
https://github.com/NixOS/nix.git
synced 2025-12-13 20:41:04 +01:00
Fix Non-virtual interface pattern for RestrictedStore::addDependency
I didn't do things quite right in496e43ec72: - Forgot to remove the now-redundant `isAllowed` check. - Called the non-virtual, not the superclass's impl, in `addDependencyPrep`, causing bad recursion / UB. Doing this fixes a crash I encountered with manual testing an Nix Ninja --- hopefully we will get Nix Ninja or similar in a NixOS test longer term to defend against this thing happening again. (cherry picked from commit4652345ac3)
This commit is contained in:
parent
ba5bede9f5
commit
d9fc17d299
2 changed files with 1 additions and 4 deletions
|
|
@ -181,7 +181,7 @@ struct ChrootDerivationBuilder : virtual DerivationBuilderImpl
|
||||||
|
|
||||||
std::pair<Path, Path> addDependencyPrep(const StorePath & path)
|
std::pair<Path, Path> addDependencyPrep(const StorePath & path)
|
||||||
{
|
{
|
||||||
DerivationBuilderImpl::addDependency(path);
|
DerivationBuilderImpl::addDependencyImpl(path);
|
||||||
|
|
||||||
debug("materialising '%s' in the sandbox", store.printStorePath(path));
|
debug("materialising '%s' in the sandbox", store.printStorePath(path));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -705,9 +705,6 @@ struct ChrootLinuxDerivationBuilder : ChrootDerivationBuilder, LinuxDerivationBu
|
||||||
|
|
||||||
void addDependencyImpl(const StorePath & path) override
|
void addDependencyImpl(const StorePath & path) override
|
||||||
{
|
{
|
||||||
if (isAllowed(path))
|
|
||||||
return;
|
|
||||||
|
|
||||||
auto [source, target] = ChrootDerivationBuilder::addDependencyPrep(path);
|
auto [source, target] = ChrootDerivationBuilder::addDependencyPrep(path);
|
||||||
|
|
||||||
/* Bind-mount the path into the sandbox. This requires
|
/* Bind-mount the path into the sandbox. This requires
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue