Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #11710 from kevincox/userenv-no-path

Remove PATH assumption from fhs-userenv.

+5 -4
+5 -4
pkgs/build-support/build-fhs-userenv/default.nix
··· 1 - { runCommand, lib, writeText, writeScriptBin, stdenv, ruby } : 2 - { env, runScript ? "bash", extraBindMounts ? [], extraInstallCommands ? "" } : 3 4 let 5 name = env.pname; 6 7 # Sandboxing script 8 chroot-user = writeScriptBin "chroot-user" '' ··· 29 runCommand "${name}-shell-env" { 30 shellHook = '' 31 export CHROOTENV_EXTRA_BINDS="${lib.concatStringsSep ":" extraBindMounts}:$CHROOTENV_EXTRA_BINDS" 32 - exec ${chroot-user}/bin/chroot-user ${env} bash -l ${init "bash"} "$(pwd)" 33 ''; 34 } '' 35 echo >&2 "" ··· 42 cat <<EOF >$out/bin/${name} 43 #! ${stdenv.shell} 44 export CHROOTENV_EXTRA_BINDS="${lib.concatStringsSep ":" extraBindMounts}:\$CHROOTENV_EXTRA_BINDS" 45 - exec ${chroot-user}/bin/chroot-user ${env} bash -l ${init runScript} "\$(pwd)" "\$@" 46 EOF 47 chmod +x $out/bin/${name} 48 ${extraInstallCommands}
··· 1 + { runCommand, lib, writeText, writeScriptBin, stdenv, bash, ruby } : 2 + { env, runScript ? "${bash}/bin/bash", extraBindMounts ? [], extraInstallCommands ? "" } : 3 4 let 5 name = env.pname; 6 + bash' = "${bash}/bin/bash"; 7 8 # Sandboxing script 9 chroot-user = writeScriptBin "chroot-user" '' ··· 30 runCommand "${name}-shell-env" { 31 shellHook = '' 32 export CHROOTENV_EXTRA_BINDS="${lib.concatStringsSep ":" extraBindMounts}:$CHROOTENV_EXTRA_BINDS" 33 + exec ${chroot-user}/bin/chroot-user ${env} ${bash'} -l ${init bash'} "$(pwd)" 34 ''; 35 } '' 36 echo >&2 "" ··· 43 cat <<EOF >$out/bin/${name} 44 #! ${stdenv.shell} 45 export CHROOTENV_EXTRA_BINDS="${lib.concatStringsSep ":" extraBindMounts}:\$CHROOTENV_EXTRA_BINDS" 46 + exec ${chroot-user}/bin/chroot-user ${env} ${bash'} -l ${init runScript} "\$(pwd)" "\$@" 47 EOF 48 chmod +x $out/bin/${name} 49 ${extraInstallCommands}