diff options
author | Lars Wendler <polynomial-c@gentoo.org> | 2018-09-19 10:32:29 +0200 |
---|---|---|
committer | Lars Wendler <polynomial-c@gentoo.org> | 2018-09-19 10:32:29 +0200 |
commit | 27aa227016ac71f90eb8c6036ab4fb2600433b02 (patch) | |
tree | 101bfe38a1b403275c43eae1a2ef1978da69e958 /sys-process/psmisc | |
parent | app-editors/nano: Bump to version 3.1 (diff) | |
download | gentoo-27aa227016ac71f90eb8c6036ab4fb2600433b02.tar.gz gentoo-27aa227016ac71f90eb8c6036ab4fb2600433b02.tar.bz2 gentoo-27aa227016ac71f90eb8c6036ab4fb2600433b02.zip |
sys-process/psmisc: v23.2: Attempt to fix "killall -SIG"
Bug: https://bugs.gentoo.org/664066
Package-Manager: Portage-2.3.49, Repoman-2.3.10
Diffstat (limited to 'sys-process/psmisc')
-rw-r--r-- | sys-process/psmisc/files/psmisc-23.2-killall_options_parsing.patch | 79 | ||||
-rw-r--r-- | sys-process/psmisc/psmisc-23.2.ebuild | 4 |
2 files changed, 83 insertions, 0 deletions
diff --git a/sys-process/psmisc/files/psmisc-23.2-killall_options_parsing.patch b/sys-process/psmisc/files/psmisc-23.2-killall_options_parsing.patch new file mode 100644 index 000000000000..48aecb24e5c4 --- /dev/null +++ b/sys-process/psmisc/files/psmisc-23.2-killall_options_parsing.patch @@ -0,0 +1,79 @@ +From 258ee9166e585f87005d3a9686938a4fa26669f9 Mon Sep 17 00:00:00 2001 +From: Craig Small <csmall@enc.com.au> +Date: Tue, 18 Sep 2018 21:17:00 +1000 +Subject: [PATCH] killall: Another go at option parsing + +This now seems to be working. There are some evil hacks, especially for +the -ve option combination but it seems that we have a winner. + +Added a bunch more option parsing tests which picked up -ILL passed but +-VTALRM did not. Not sure why, but length seems my guess + +References: + psmisc/psmisc#13 + psmisc/psmisc#12 +--- + +diff --git a/src/killall.c b/src/killall.c +index 64c406a..2715515 100644 +--- a/src/killall.c ++++ b/src/killall.c +@@ -857,7 +857,7 @@ main (int argc, char **argv) + + opterr = 0; + #ifdef WITH_SELINUX +- while ( (optc = getopt_long(argc,argv,"egy:o:ilqrs:u:vwZ:VIn:",options,NULL)) != -1) { ++ while ( (optc = getopt_long_only(argc,argv,"egy:o:ilqrs:u:vwZ:VIn:",options,NULL)) != -1) { + #else + while ( (optc = getopt_long_only(argc,argv,"egy:o:ilqrs:u:vwVIn:",options,NULL)) != -1) { + #endif +@@ -914,7 +914,7 @@ main (int argc, char **argv) + ignore_case = 1; + } else { + sig_num = get_signal (argv[optind]+1, "killall"); +- skip_error=1; ++ skip_error=optind; + } + break; + case 'V': +@@ -922,8 +922,10 @@ main (int argc, char **argv) + if (strcmp(argv[optind-1],"-V") == 0 || strncmp(argv[optind-1],"--",2) == 0) { + print_version(); + return 0; ++ } else { ++ sig_num = get_signal (argv[optind]+1, "killall"); ++ skip_error=optind; + } +- sig_num = get_signal (argv[optind]+1, "killall"); + break; + case 'n': { + long num; +@@ -948,6 +950,15 @@ main (int argc, char **argv) + break; + #endif /*WITH_SELINUX*/ + case '?': ++ if (skip_error == optind) ++ break; ++ /* Sigh, this is a hack because -ve could be -version or ++ * -verbose */ ++ if (strncmp(argv[optind-1], "-ve", 3) == 0) { ++ verbose=1; ++ exact=1; ++ break; ++ } + /* Signal names are in uppercase, so check to see if the argv + * is upper case */ + if (argv[optind-1][1] >= 'A' && argv[optind-1][1] <= 'Z') { +@@ -957,9 +968,6 @@ main (int argc, char **argv) + if (argv[optind-1][1] >= '0' && argv[optind-1][1] <= '9') { + sig_num = atoi(argv[optind-1]+1); + } else { +- if (skip_error) +- skip_error=0; +- else + usage(NULL); + } + } +-- +2.18.0 + diff --git a/sys-process/psmisc/psmisc-23.2.ebuild b/sys-process/psmisc/psmisc-23.2.ebuild index 5b4a7b8c7126..dd989ab0b6ba 100644 --- a/sys-process/psmisc/psmisc-23.2.ebuild +++ b/sys-process/psmisc/psmisc-23.2.ebuild @@ -21,6 +21,10 @@ DEPEND="${RDEPEND} DOCS=( AUTHORS ChangeLog NEWS README ) +PATCHES=( + "${FILESDIR}/${P}-killall_options_parsing.patch" +) + src_configure() { local myeconfargs=( --disable-harden-flags |