1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00

fix throwing output paths out of sandbox paths

It seems obvious that erasing any output paths from pathsInChroot needs
to happen after getPathsInSandbox(), not before.

Signed-off-by: Samuli Thomasson <samuli.thomasson@pm.me>
This commit is contained in:
Samuli Thomasson 2025-06-12 21:27:30 +02:00
parent 371fcf91c3
commit 0f6cb33763
No known key found for this signature in database
GPG key ID: 6B8903D2645A5B48

View file

@ -368,6 +368,13 @@ struct ChrootLinuxDerivationBuilder : LinuxDerivationBuilder
if (buildUser && chown(chrootStoreDir.c_str(), 0, buildUser->getGID()) == -1) if (buildUser && chown(chrootStoreDir.c_str(), 0, buildUser->getGID()) == -1)
throw SysError("cannot change ownership of '%1%'", chrootStoreDir); throw SysError("cannot change ownership of '%1%'", chrootStoreDir);
pathsInChroot = getPathsInSandbox();
for (auto & i : inputPaths) {
auto p = store.printStorePath(i);
pathsInChroot.insert_or_assign(p, store.toRealPath(p));
}
/* If we're repairing, checking or rebuilding part of a /* If we're repairing, checking or rebuilding part of a
multiple-outputs derivation, it's possible that we're multiple-outputs derivation, it's possible that we're
rebuilding a path that is in settings.sandbox-paths rebuilding a path that is in settings.sandbox-paths
@ -391,13 +398,6 @@ struct ChrootLinuxDerivationBuilder : LinuxDerivationBuilder
chownToBuilder(*cgroup + "/cgroup.threads"); chownToBuilder(*cgroup + "/cgroup.threads");
// chownToBuilder(*cgroup + "/cgroup.subtree_control"); // chownToBuilder(*cgroup + "/cgroup.subtree_control");
} }
pathsInChroot = getPathsInSandbox();
for (auto & i : inputPaths) {
auto p = store.printStorePath(i);
pathsInChroot.insert_or_assign(p, store.toRealPath(p));
}
} }
Strings getPreBuildHookArgs() override Strings getPreBuildHookArgs() override