fixed output derivations: fix incorrect responses for getpwuid

Passing nscd socket into the build environment causes unexpected behavior in programs that make getpwuid and other related calls.

relevant threads:
- https://github.com/NixOS/nix/issues/4991
- https://discourse.nixos.org/t/haunted-nix-build-breaks-isolation/13869
This commit is contained in:
illustris 2021-07-13 15:34:14 +05:30
parent 9cf991f421
commit 7bc17a903b

View file

@ -1754,7 +1754,7 @@ void LocalDerivationGoal::runChild()
/* N.B. it is realistic that these paths might not exist. It /* N.B. it is realistic that these paths might not exist. It
happens when testing Nix building fixed-output derivations happens when testing Nix building fixed-output derivations
within a pure derivation. */ within a pure derivation. */
for (auto & path : { "/etc/resolv.conf", "/etc/services", "/etc/hosts", "/var/run/nscd/socket" }) for (auto & path : { "/etc/resolv.conf", "/etc/services", "/etc/hosts" })
if (pathExists(path)) if (pathExists(path))
ss.push_back(path); ss.push_back(path);
} }