diff options
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/os-specific/linux/libcap/progs-bash-path.patch | 15 | ||||
-rw-r--r-- | pkgs/os-specific/linux/libcap/progs.nix | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/libcap/progs-bash-path.patch b/pkgs/os-specific/linux/libcap/progs-bash-path.patch new file mode 100644 index 0000000000000..359d95400fa65 --- /dev/null +++ b/pkgs/os-specific/linux/libcap/progs-bash-path.patch @@ -0,0 +1,15 @@ +this patch set the bash path from '/bin/bash' to '/var/run/current-system/sw/bin/bash' + +diff --git a/progs/capsh.c b/progs/capsh.c +index 52336d7..fd98a03 100644 +--- a/progs/capsh.c ++++ b/progs/capsh.c +@@ -556,7 +556,7 @@ int main(int argc, char *argv[], char *envp[]) + } + printf("\n"); + } else if ((!strcmp("--", argv[i])) || (!strcmp("==", argv[i]))) { +- argv[i] = strdup(argv[i][0] == '-' ? "/bin/bash" : argv[0]); ++ argv[i] = strdup(argv[i][0] == '-' ? "/var/run/current-system/sw/bin/bash" : argv[0]); + argv[argc] = NULL; + execve(argv[i], argv+i, envp); + fprintf(stderr, "execve /bin/bash failed!\n"); diff --git a/pkgs/os-specific/linux/libcap/progs.nix b/pkgs/os-specific/linux/libcap/progs.nix index 1902b4acb1a4c..c287c4379586f 100644 --- a/pkgs/os-specific/linux/libcap/progs.nix +++ b/pkgs/os-specific/linux/libcap/progs.nix @@ -9,6 +9,8 @@ stdenv.mkDerivation rec { buildInputs = [ libcap ]; + patches = [ ./progs-bash-path.patch ]; + preConfigure = "cd progs"; installFlags = "RAISE_SETFCAP=no"; |