summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wendler <polynomial-c@gentoo.org>2021-03-18 08:56:13 +0100
committerLars Wendler <polynomial-c@gentoo.org>2021-03-18 08:56:13 +0100
commit15b8669a37ecca9ef3a0558a306492dc26176e03 (patch)
treebbf43eec893a9d6181bdece2bb0637076cf0b6f9 /sys-process/psmisc
parentdev-util/cmake: Bump to version 3.20.0_rc5. Removed old (diff)
downloadgentoo-15b8669a37ecca9ef3a0558a306492dc26176e03.tar.gz
gentoo-15b8669a37ecca9ef3a0558a306492dc26176e03.tar.bz2
gentoo-15b8669a37ecca9ef3a0558a306492dc26176e03.zip
sys-process/psmisc: Revbump to fix a fuser regression
by reverting the offending upstream commit: https://gitlab.com/psmisc/psmisc/-/issues/35 Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Diffstat (limited to 'sys-process/psmisc')
-rw-r--r--sys-process/psmisc/files/psmisc-23.4-fuser_regression_revert.patch45
-rw-r--r--sys-process/psmisc/psmisc-23.4-r1.ebuild51
2 files changed, 96 insertions, 0 deletions
diff --git a/sys-process/psmisc/files/psmisc-23.4-fuser_regression_revert.patch b/sys-process/psmisc/files/psmisc-23.4-fuser_regression_revert.patch
new file mode 100644
index 000000000000..59b2bfcef1de
--- /dev/null
+++ b/sys-process/psmisc/files/psmisc-23.4-fuser_regression_revert.patch
@@ -0,0 +1,45 @@
+https://gitlab.com/psmisc/psmisc/-/issues/35
+
+diff --git a/ChangeLog b/ChangeLog
+index df45ae3..be20ca0 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -5,8 +5,6 @@ Changes in 23.4
+ * pstree: fix layout when using -C !24
+ * pstree: add time namespace !25
+ * pstree: Dynamically link to selinux and use attr
+- * fuser: Get less confused about duplicate dev_id !10
+- * fuser: Only check pathname on non-block devices !31
+
+ Changes in 23.3
+ ===============
+diff --git a/src/fuser.c b/src/fuser.c
+index 03e6237..f9d78db 100644
+--- a/src/fuser.c
++++ b/src/fuser.c
+@@ -1566,7 +1566,6 @@ check_dir(const pid_t pid, const char *dirname, struct device_list *dev_head,
+ struct stat st, lst;
+ char *dirpath;
+ char filepath[PATH_MAX];
+- char real_filepath[PATH_MAX];
+
+ if (asprintf(&dirpath, "/proc/%d/%s", pid, dirname) < 0)
+ return;
+@@ -1605,17 +1604,6 @@ check_dir(const pid_t pid, const char *dirname, struct device_list *dev_head,
+ dev_tmp = dev_tmp->next) {
+ if (thedev != dev_tmp->device)
+ continue;
+-
+- /* check the paths match if it is not a block device */
+- if (! S_ISBLK(dev_tmp->name->st.st_mode)) {
+- if (readlink(filepath, real_filepath, PATH_MAX-1) < 0) {
+- if (strncmp(dev_tmp->name->filename, filepath, strlen(dev_tmp->name->filename)) != 0)
+- continue;
+- } else {
+- if (strncmp(dev_tmp->name->filename, real_filepath, strlen(dev_tmp->name->filename)) != 0)
+- continue;
+- }
+- }
+ if (access == ACCESS_FILE
+ && (lstat(filepath, &lst) == 0)
+ && (lst.st_mode & S_IWUSR)) {
diff --git a/sys-process/psmisc/psmisc-23.4-r1.ebuild b/sys-process/psmisc/psmisc-23.4-r1.ebuild
new file mode 100644
index 000000000000..7f5ad69fee46
--- /dev/null
+++ b/sys-process/psmisc/psmisc-23.4-r1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+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 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="ipv6 nls selinux X"
+
+RDEPEND="!=app-i18n/man-pages-l10n-4.0.0-r0
+ >=sys-libs/ncurses-5.7-r7:0=
+ nls? ( virtual/libintl )
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}"
+BDEPEND=">=sys-devel/libtool-2.2.6b
+ nls? ( sys-devel/gettext )"
+
+DOCS=( AUTHORS ChangeLog NEWS README )
+
+PATCHES=(
+ # https://gitlab.com/psmisc/psmisc/-/issues/35
+ "${FILESDIR}/${PN}-23.4-fuser_regression_revert.patch"
+)
+
+src_configure() {
+ local myeconfargs=(
+ --disable-harden-flags
+ $(use_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
+}