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