libcap_progs: fix bash path

* in progs/capsh.c is the bash path hardcoded to '/bin/bash'.
  * this fix removes the absolute path und use 'execvpe' to call 'bash'.
wip/yesman
j-keck 10 years ago
parent 236f7fd20d
commit 73ec7f243f
  1. 7
      pkgs/os-specific/linux/libcap/progs.nix

@ -10,8 +10,11 @@ stdenv.mkDerivation rec {
buildInputs = [ libcap ];
prePatch = ''
BASH=$(type -tp bash)
substituteInPlace progs/capsh.c --replace "/bin/bash" "$BASH"
# use relative bash path
substituteInPlace progs/capsh.c --replace "/bin/bash" "bash"
# ensure capsh can find bash in $PATH
substituteInPlace progs/capsh.c --replace execve execvpe
'';
preConfigure = "cd progs";

Loading…
Cancel
Save