summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-05-18 04:19:01 +0000
committerMike Frysinger <vapier@gentoo.org>2015-05-18 04:19:01 +0000
commit6d6bdf1bf2b2bcf2587b7ebbcf0aa5f4e424f673 (patch)
tree6c4a71624cad1271f27738bf493602832b35a5cc
parentBump (diff)
downloadgentoo-2-6d6bdf1bf2b2bcf2587b7ebbcf0aa5f4e424f673.tar.gz
gentoo-2-6d6bdf1bf2b2bcf2587b7ebbcf0aa5f4e424f673.tar.bz2
gentoo-2-6d6bdf1bf2b2bcf2587b7ebbcf0aa5f4e424f673.zip
Fix pmap test when running under restrictive kernel/user settings #404389 by Markus Oehme.
(Portage version: 2.2.19/cvs/Linux x86_64, signed Manifest commit with key D2E96200)
-rw-r--r--sys-process/procps/ChangeLog7
-rw-r--r--sys-process/procps/files/procps-3.3.10-pmap-unreadable.patch60
-rw-r--r--sys-process/procps/procps-3.3.10-r1.ebuild11
3 files changed, 74 insertions, 4 deletions
diff --git a/sys-process/procps/ChangeLog b/sys-process/procps/ChangeLog
index 2cd282e29187..6dea75b4d880 100644
--- a/sys-process/procps/ChangeLog
+++ b/sys-process/procps/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for sys-process/procps
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-process/procps/ChangeLog,v 1.137 2015/03/02 09:32:39 ago Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-process/procps/ChangeLog,v 1.138 2015/05/18 04:19:01 vapier Exp $
+
+ 18 May 2015; Mike Frysinger <vapier@gentoo.org>
+ +files/procps-3.3.10-pmap-unreadable.patch, procps-3.3.10-r1.ebuild:
+ Fix pmap test when running under restrictive kernel/user settings #404389 by
+ Markus Oehme.
02 Mar 2015; Agostino Sarubbo <ago@gentoo.org> procps-3.3.9.ebuild:
Stable for ppc, wrt bug #510316
diff --git a/sys-process/procps/files/procps-3.3.10-pmap-unreadable.patch b/sys-process/procps/files/procps-3.3.10-pmap-unreadable.patch
new file mode 100644
index 000000000000..697674861bff
--- /dev/null
+++ b/sys-process/procps/files/procps-3.3.10-pmap-unreadable.patch
@@ -0,0 +1,60 @@
+https://bugs.gentoo.org/404389
+
+From 92071e963e6ff50f0e221dde286f3229267b2ff9 Mon Sep 17 00:00:00 2001
+From: Craig Small <csmall@enc.com.au>
+Date: Sat, 24 Jan 2015 18:53:29 +1100
+Subject: [PATCH] pmap: print process even if smaps unreadable
+
+pmap would previously print the process name if
+/proc/PID/smaps could be opened, even if subsequent
+reads failed. This actually occurs with other users
+PIDs.
+
+Kernel 3.18rc1 introduced a change where the file could
+not been opened, meaning pmap -X 1 previously showed
+the process name and nothing else but NOW shows nothing
+make check failed because of this.
+
+This change prints the process name even before trying to open
+the file, returning it to previous behaviour.
+Thanks to Vincent Bernat for some analysis.
+
+References:
+ https://bugs.debian.org/775624
+ https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=29a40ace841cba9b661711f042d1821cdc4ad47c
+
+Signed-off-by: Craig Small <csmall@enc.com.au>
+---
+ NEWS | 1 +
+ pmap.c | 8 ++++----
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/pmap.c b/pmap.c
+index c83617c..17e0e30 100644
+--- a/pmap.c
++++ b/pmap.c
+@@ -533,6 +533,10 @@ static int one_proc(proc_t * p)
+ */
+ int maxcmd = 0xfffff;
+
++ escape_command(cmdbuf, p, sizeof cmdbuf, &maxcmd,
++ ESC_ARGS | ESC_BRACKETS);
++ printf("%u: %s\n", p->tgid, cmdbuf);
++
+ if (x_option || X_option || c_option) {
+ sprintf(buf, "/proc/%u/smaps", p->tgid);
+ if ((fp = fopen(buf, "r")) == NULL)
+@@ -543,10 +547,6 @@ static int one_proc(proc_t * p)
+ return 1;
+ }
+
+- escape_command(cmdbuf, p, sizeof cmdbuf, &maxcmd,
+- ESC_ARGS | ESC_BRACKETS);
+- printf("%u: %s\n", p->tgid, cmdbuf);
+-
+ if (X_option || c_option) {
+ print_extended_maps(fp);
+ return 0;
+--
+2.4.0
+
diff --git a/sys-process/procps/procps-3.3.10-r1.ebuild b/sys-process/procps/procps-3.3.10-r1.ebuild
index 94548659b4b5..8201bebf296c 100644
--- a/sys-process/procps/procps-3.3.10-r1.ebuild
+++ b/sys-process/procps/procps-3.3.10-r1.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-process/procps/procps-3.3.10-r1.ebuild,v 1.1 2014/09/24 06:14:53 polynomial-c Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-process/procps/procps-3.3.10-r1.ebuild,v 1.2 2015/05/18 04:19:01 vapier Exp $
EAPI="4"
@@ -32,7 +32,8 @@ S=${WORKDIR}/${PN}-ng-${PV}
src_prepare() {
epatch \
- "${FILESDIR}"/${PN}-3.3.8-kill-neg-pid.patch
+ "${FILESDIR}"/${PN}-3.3.8-kill-neg-pid.patch \
+ "${FILESDIR}"/${P}-pmap-unreadable.patch
sed -i -e 's:systemd-login:systemd:' configure || die #501306
}
@@ -49,6 +50,10 @@ src_configure() {
$(use_enable unicode watch8bit)
}
+src_test() {
+ emake check </dev/null
+}
+
src_install() {
default
#dodoc sysctl.conf