summaryrefslogtreecommitdiff
path: root/sys-process/psmisc
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-10-28 09:59:10 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-10-28 09:59:10 +0100
commit8eb973cc2247ee4fe34e4d907fdc6cf5b94709e3 (patch)
tree0834df6dbfa798c2c138698cc26cf6a731fe937e /sys-process/psmisc
parente5985b8e66b3b43c34328efb47b9b12e8ce5a690 (diff)
gentoo auto-resync : 28:10:2022 - 09:59:10
Diffstat (limited to 'sys-process/psmisc')
-rw-r--r--sys-process/psmisc/Manifest5
-rw-r--r--sys-process/psmisc/files/psmisc-23.5-fix-killall-pidfd_send_signal.patch40
-rw-r--r--sys-process/psmisc/psmisc-23.4-r1.ebuild21
-rw-r--r--sys-process/psmisc/psmisc-23.5.ebuild73
4 files changed, 132 insertions, 7 deletions
diff --git a/sys-process/psmisc/Manifest b/sys-process/psmisc/Manifest
index 63effc5c5203..11e3b89dc664 100644
--- a/sys-process/psmisc/Manifest
+++ b/sys-process/psmisc/Manifest
@@ -1,4 +1,7 @@
AUX psmisc-23.4-fuser_regression_revert.patch 1577 BLAKE2B 89f346146ca2fb71bc5bee87f880abcc6e2e9c6b5c3e911fb806ced2a89ba096de6ce052bf238f1c8df948ec1fba5b979763fd2baa6e0a7b46ba977482f82501 SHA512 b129d3355a022b0bd743a06a4912b1ddea386af0d1551fadbe8155e1733ac03df3c795a4997759c4db6299196af3b49dfb2c9e6840dc33174ee1f4afe4ef9df7
+AUX psmisc-23.5-fix-killall-pidfd_send_signal.patch 1384 BLAKE2B 246636fe31d9602cd68310ed8c637fa2f62dfa98bdc9cc958bd2e7ab6eaf358dd516cc49db4bbbe892d62375d5f7613b04fa98532e225d9fdff2dc142e596459 SHA512 23117b10094be12b64545ccd1fa9c2e2901e0ab7ab4e84dc9428e27358fa83bff01b4e790f21e14b74c0db2dd01ee83ba6234cbf975f275d21677a0dbda1f444
DIST psmisc-23.4.tar.xz 370000 BLAKE2B e762171c4d3252421a49b352fadb3e892f66862f003a313a0cc692f973364b06d2652a51d331314462784d94ad55189e74c4d7a023d5d7c917c5e5c05009f46b SHA512 b05781fdb283a6f132bd385d64437f8080e6bc0e11cd2e3e02227678682bb67b3c89edec34a6d067d77312811d072dc60b47ebb32b168c4c69bbc36df643a471
-EBUILD psmisc-23.4-r1.ebuild 1768 BLAKE2B 2e8c307bfcf9cd1137dda7275914f283e4689ad79d940e6294abfb8dc051ebb61ccf5ea2e6305bbfe57157fa61495ea48d6014f8b60fec32332961d3ef7dfe58 SHA512 4497d4084e46c389c4f32a91a951a10d069b68a4426869c6b012a08655413589c2c9e2692208de80c31523b0684321b5701ea428c75e15bc4e23872055e1e3b2
+DIST psmisc-23.5.tar.xz 394012 BLAKE2B 258b82c9fff3765f33cdcd4150489b3e585a47b9065b1cb4f5b432bea4aa7766aab15b160cfb948df9e835c7ac09a9f185d663ab1cd376bedea53bdaf73fd776 SHA512 e908220350491a595ceaf96025a9aa14d832cacc8901545d0864152053fedaf9dc10f45fb2870aa2a00e4d9d8947243038357e14a82b04ab5d20c53e7f841a8d
+EBUILD psmisc-23.4-r1.ebuild 1889 BLAKE2B 59779553f91f16b8dec506c1309b5480985cd739ae1c0a1d569b52cb3402bb1d94b7869f990fdfd396ac341022461f1043ce383903b95c599397a5343e3f85e1 SHA512 eb829e935c7cb7d5a9ca96cbccd26eb6703d0ea224ffd4713db925078cdc141bc110ad3f21becfa33663c3ef1627ca6550fe7ef4e0e4c723d74f1cc4bcb1eb52
+EBUILD psmisc-23.5.ebuild 1955 BLAKE2B 07f8a1a716c076d8dc58045cbe58969e29c87cfc95222dadc6273a90abd9675a4cfb0fa11d727c9dec1187d85ef2781af07c895175977d9309b1abf581a6d37b SHA512 ef032b48b8f8d82d1d157127b94300a6a8e65d3dfbccaded56fe3b7fe79170d62b3ff3930f4835e4c5abba7cb428d1e21557e69da15816504891318a2b7578da
MISC metadata.xml 387 BLAKE2B 86be283c90e1b90bd40313187a4caa0ec871807fe1045649f2bff8934ee9537a348ee096a63ed2cfb2991724bf79e8dc7dd65d5cb4812216bbd10ebf5e400a71 SHA512 8594d6e68c03adf48e92947d47a3b477768fd296d8db62cfcae8982dcc872e947780bfdb11a4f3b1658b00928eccd2d7b58b03eea388c51806a45ae47e8c59d5
diff --git a/sys-process/psmisc/files/psmisc-23.5-fix-killall-pidfd_send_signal.patch b/sys-process/psmisc/files/psmisc-23.5-fix-killall-pidfd_send_signal.patch
new file mode 100644
index 000000000000..0fc9c30a9635
--- /dev/null
+++ b/sys-process/psmisc/files/psmisc-23.5-fix-killall-pidfd_send_signal.patch
@@ -0,0 +1,40 @@
+https://gitlab.com/psmisc/psmisc/-/commit/6892e321e7042e3df60a5501a1c59d076e8a856f
+
+From 6892e321e7042e3df60a5501a1c59d076e8a856f Mon Sep 17 00:00:00 2001
+From: Craig Small <csmall@dropbear.xyz>
+Date: Mon, 18 Jul 2022 20:16:42 +1000
+Subject: [PATCH] killall: use kill if pidfd_send_signal() fails
+
+The pidfd_send_signal() system call appeared in Linux 5.1
+If psmisc is build on a system before then, or a non-Linux
+system, then kill() is used instead. However if psmisc is
+built on a Linux >= 5.1 system but run on a < 5.1 Linux
+system the system call fails and killall doesn't work.
+
+The fix, as proposed by Peter T. Breuer, is to try
+pidfd_send_signal() and if the return value is < 0 and
+errno is ENOSYS then we know at runtime the system call
+failed and we fall through to trusty old kill().
+
+Note, this means that killall on systems below 5.1 still
+have the race PID condition that the pidfd calls fix.
+
+References:
+ https://bugs.debian.org/1015228
+--- a/src/killall.c
++++ b/src/killall.c
+@@ -326,7 +326,12 @@ my_send_signal(
+ {
+ #ifdef __NR_pidfd_send_signal
+ if (pid > 0) /* Not PGID */
+- return syscall(__NR_pidfd_send_signal, pidfd, sig, NULL, 0);
++ {
++ int ret = syscall(__NR_pidfd_send_signal, pidfd, sig, NULL, 0);
++ if (ret >= 0 || errno != ENOSYS)
++ return ret;
++ // fall through if no such syscall
++ }
+ #endif
+ return kill(pid, sig);
+ }
+GitLab
diff --git a/sys-process/psmisc/psmisc-23.4-r1.ebuild b/sys-process/psmisc/psmisc-23.4-r1.ebuild
index 3d1f44243e5f..d878cf0a9306 100644
--- a/sys-process/psmisc/psmisc-23.4-r1.ebuild
+++ b/sys-process/psmisc/psmisc-23.4-r1.ebuild
@@ -12,15 +12,21 @@ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.xz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
-IUSE="ipv6 nls selinux X"
+IUSE="ipv6 nls selinux test X"
+RESTRICT="!test? ( test )"
-RDEPEND="!=app-i18n/man-pages-l10n-4.0.0-r0
- >=sys-libs/ncurses-5.7-r7:0=
+RDEPEND="
+ !=app-i18n/man-pages-l10n-4.0.0-r0
+ >=sys-libs/ncurses-5.7-r7:=
nls? ( virtual/libintl )
- selinux? ( sys-libs/libselinux )"
+ selinux? ( sys-libs/libselinux )
+"
DEPEND="${RDEPEND}"
-BDEPEND=">=sys-devel/libtool-2.2.6b
- nls? ( sys-devel/gettext )"
+BDEPEND="
+ >=sys-devel/libtool-2.2.6b
+ nls? ( sys-devel/gettext )
+ test? ( dev-util/dejagnu )
+"
DOCS=( AUTHORS ChangeLog NEWS README )
@@ -40,6 +46,9 @@ src_configure() {
ac_cv_func_realloc_0_nonnull=yes
fi
+ # bug #802414
+ touch testsuite/global-conf.exp || die
+
local myeconfargs=(
--disable-harden-flags
$(use_enable ipv6)
diff --git a/sys-process/psmisc/psmisc-23.5.ebuild b/sys-process/psmisc/psmisc-23.5.ebuild
new file mode 100644
index 000000000000..221b3631be6d
--- /dev/null
+++ b/sys-process/psmisc/psmisc-23.5.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="A set of tools that use the proc filesystem"
+HOMEPAGE="http://psmisc.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="nls selinux test X"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ !=app-i18n/man-pages-l10n-4.0.0-r0
+ >=sys-libs/ncurses-5.7-r7:=
+ nls? ( virtual/libintl )
+ selinux? ( sys-libs/libselinux )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ >=sys-devel/libtool-2.2.6b
+ nls? ( sys-devel/gettext )
+ test? ( dev-util/dejagnu )
+"
+
+DOCS=( AUTHORS ChangeLog NEWS README )
+
+PATCHES=(
+ "${FILESDIR}"/${P}-fix-killall-pidfd_send_signal.patch
+)
+
+src_configure() {
+ if tc-is-cross-compiler ; then
+ # This isn't ideal but upstream don't provide a placement
+ # when malloc is missing anyway, leading to errors like:
+ # pslog.c:(.text.startup+0x108): undefined reference to `rpl_malloc'
+ # See https://sourceforge.net/p/psmisc/bugs/71/
+ # (and https://lists.gnu.org/archive/html/autoconf/2011-04/msg00019.html)
+ export ac_cv_func_malloc_0_nonnull=yes \
+ ac_cv_func_realloc_0_nonnull=yes
+ fi
+
+ # No longer needed in > 23.5
+ # https://gitlab.com/psmisc/psmisc/-/commit/3fac667430341bdcec733da6eacd88b03813467a
+ # bug #802414
+ touch testsuite/global-conf.exp || die
+
+ local myeconfargs=(
+ --disable-harden-flags
+ --enable-ipv6
+ $(use_enable nls)
+ $(use_enable selinux)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ default
+
+ use X || rm -f "${ED}"/usr/bin/pstree.x11
+
+ [[ -s ${ED}/usr/bin/peekfd ]] || rm -f "${ED}"/usr/bin/peekfd
+ [[ -e ${ED}/usr/bin/peekfd ]] || rm -f "${ED}"/usr/share/man/man1/peekfd.1
+
+ # fuser is needed by init.d scripts; use * wildcard for #458250
+ dodir /bin
+ mv "${ED}"/usr/bin/*fuser "${ED}"/bin || die
+}