diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2019-10-08 22:41:05 -0400 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2019-10-08 22:41:59 -0400 |
commit | 65f6d5db6f5ef2724a3dc03e1773c510123287f1 (patch) | |
tree | 24f00b0ca251b0890de441c085cb1c8d3e8febad /src | |
parent | a7e92863593792e7dc550effa8f6be08e6af7e3f (diff) |
Don’t source bashrc in pure mode
Pure mode should not try to source the user’s bashrc file. These may
have many impurities that the user does not expect to get into their
shell.
Fixes #3090
Diffstat (limited to 'src')
-rwxr-xr-x | src/nix-build/nix-build.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nix-build/nix-build.cc b/src/nix-build/nix-build.cc index 2b36846cd..3e1081c05 100755 --- a/src/nix-build/nix-build.cc +++ b/src/nix-build/nix-build.cc @@ -412,7 +412,7 @@ static void _main(int argc, char * * argv) auto rcfile = (Path) tmpDir + "/rc"; writeFile(rcfile, fmt( (keepTmp ? "" : "rm -rf '%1%'; "s) + - "[ -n \"$PS1\" ] && [ -e ~/.bashrc ] && source ~/.bashrc; " + (pure ? "" : "[ -n \"$PS1\" ] && [ -e ~/.bashrc ] && source ~/.bashrc;") "%2%" "dontAddDisableDepTrack=1; " "[ -e $stdenv/setup ] && source $stdenv/setup; " |