bash: fix segfault with kill_by_name() on x86_64.

* missing libgen.h include would default return value of basename()
to int instead of char*.
This commit is contained in:
Jerome Duval
2016-04-30 18:09:46 +00:00
parent d15e3fb71b
commit 88f0e6c543
2 changed files with 14 additions and 16 deletions

View File

@@ -51,11 +51,11 @@ CHECKSUM_SHA256_038="adbeaa500ca7a82535f0e88d673661963f8a5fcdc7ad63445e68bf5b497
CHECKSUM_SHA256_039="ab94dced2215541097691f60c3eb323cc28ef2549463e6a5334bbcc1e61e74ec"
CHECKSUM_SHA256_040="84bb396b9262992ca5424feab6ed3ec39f193ef5c76dfe4a62b551bd8dd9d76b"
CHECKSUM_SHA256_041="4ec432966e4198524a7e0cd685fe222e96043769c9613e66742ac475db132c1a"
CHECKSUM_SHA256_042="b75a53141ab3d8fff3fa74b5f3dc76468b01eae299f50bbc2bc71ae395d690af"
CHECKSUM_SHA256_042="ac219322db2791da87a496ee6e8e5544846494bdaaea2626270c2f73c1044919"
PATCHES="bash-kill_by_name.patch"
SOURCE_DIR="bash-4.3"
REVISION="2"
REVISION="3"
LICENSE="GNU GPL v3"
COPYRIGHT="1987-2014 Free Software Foundation, Inc."
ARCHITECTURES="x86_gcc2 x86 x86_64"

View File

@@ -6,26 +6,27 @@ Subject: [PATCH] Patch bash's builtin kill...
... to handle the kill by name functionality. Fixes #9687 and
reintroduces the ability to kill jobs.
---
builtins/kill.def | 73 ++++++++++++++++++++++++++++++++++++++++++++-----------
1 file changed, 59 insertions(+), 14 deletions(-)
diff --git a/builtins/kill.def b/builtins/kill.def
index 2e68f03..994b179 100644
index 2e68f03..7fa3191 100644
--- a/builtins/kill.def
+++ b/builtins/kill.def
@@ -54,6 +54,8 @@ $END
@@ -54,9 +54,12 @@ $END
# include <unistd.h>
#endif
+#include <OS.h>
+
#include "../bashansi.h"
#include "../bashintl.h"
@@ -79,6 +81,42 @@ static void kill_error __P((pid_t, int));
+#include <libgen.h>
#include <signal.h>
#include "../shell.h"
@@ -79,6 +82,42 @@ static void kill_error __P((pid_t, int));
# define CONTINUE_OR_FAIL goto continue_killing
#endif /* CONTINUE_AFTER_KILL_ERROR */
+int kill_by_name(int signum, const char *name)
+{
+ team_info teamInfo;
@@ -65,9 +66,9 @@ index 2e68f03..994b179 100644
/* Here is the kill builtin. We only have it so that people can type
kill -KILL %1? No, if you fill up the process table this way you
can still kill some. */
@@ -179,20 +217,27 @@ kill_builtin (list)
@@ -179,20 +218,27 @@ kill_builtin (list)
word++;
/* Use the entire argument in case of minus sign presence. */
- if (*word && legal_number (list->word->word, &pid_value) && (pid_value == (pid_t)pid_value))
- {
@@ -107,6 +108,3 @@ index 2e68f03..994b179 100644
}
#if defined (JOB_CONTROL)
else if (*list->word->word && *list->word->word != '%')
--
1.8.3.4