aboutsummaryrefslogtreecommitdiff
path: root/src/nix-build
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-10-08 22:41:05 -0400
committerMatthew Bauer <mjbauer95@gmail.com>2019-10-08 22:41:59 -0400
commit65f6d5db6f5ef2724a3dc03e1773c510123287f1 (patch)
tree24f00b0ca251b0890de441c085cb1c8d3e8febad /src/nix-build
parenta7e92863593792e7dc550effa8f6be08e6af7e3f (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/nix-build')
-rwxr-xr-xsrc/nix-build/nix-build.cc2
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; "