1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-29 09:02:46 +00:00
nixpkgs/pkgs/os-specific/linux/libcap/progs.nix
j-keck 73ec7f243f 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'.
2015-02-03 11:11:17 +01:00

26 lines
506 B
Nix

{stdenv, libcap}:
assert stdenv.isLinux;
stdenv.mkDerivation rec {
name = "libcap-progs-${libcap.version}";
inherit (libcap) src makeFlags;
buildInputs = [ libcap ];
prePatch = ''
# 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";
installFlags = "RAISE_SETFCAP=no";
postInstall = libcap.postinst name;
}