mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 06:14:26 +03:00
libcap_progs: fix bash path
* in progs/capsh.c is the bash path hardcoded to '/bin/bash'. * this fix set's the bash path from PATH.
This commit is contained in:
parent
eb54864494
commit
236f7fd20d
@ -1,15 +0,0 @@
|
||||
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");
|
@ -9,7 +9,10 @@ stdenv.mkDerivation rec {
|
||||
|
||||
buildInputs = [ libcap ];
|
||||
|
||||
patches = [ ./progs-bash-path.patch ];
|
||||
prePatch = ''
|
||||
BASH=$(type -tp bash)
|
||||
substituteInPlace progs/capsh.c --replace "/bin/bash" "$BASH"
|
||||
'';
|
||||
|
||||
preConfigure = "cd progs";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user