File procps-ng-3.3.8-selinux.patch of Package procps.8447

--- ps/Makefile.am
+++ ps/Makefile.am	2013-05-29 11:00:12.549939319 +0000
@@ -3,7 +3,7 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir)/include \
 	-DLOCALEDIR=\"$(localedir)\"
 
-AM_LDFLAGS = ../proc/libprocps.la
+AM_LDFLAGS = ../proc/libprocps.la -ldl
 
 if WITH_SYSTEMD
 AM_LDFLAGS += @SYSTEMD_LIBS@
--- ps/parser.c
+++ ps/parser.c	2013-05-29 10:57:34.177440830 +0000
@@ -238,7 +238,7 @@ static const char *parse_sysv_option(voi
     // In the meantime, please do not add to it. The list is
     // intended to ONLY contain flags defined by the POSIX and UNIX
     // standards published by The Open Group, IEEE, and ISO.
-    if(!strchr("aAdefgGlnoptuU", *flagptr)) not_pure_unix = 1;  // dude, -Z ain't in POSIX
+    if(!strchr("aAdefgGlnoptuUZ", *flagptr)) not_pure_unix = 1;  // dude, -Z ain't in POSIX
 
     switch(*flagptr){
     case 'A':
--- ps/ps.1
+++ ps/ps.1	2012-06-01 15:22:45.268010363 +0000
@@ -423,6 +423,9 @@ option, which
 .B \-F
 implies.
 .TP
+.BI \-Z
+display security context format (SELinux, etc.)
+.TP
 .BI \-\-format \ format
 user\-defined format.  Identical to
 .B \-o
--- w.c
+++ w.c	2013-05-29 10:57:34.349888215 +0000
@@ -356,6 +356,12 @@ static const proc_t *getproc(const utmp_
 			continue;
 		best = tmp;
 	}
+	/*
+	 * It is there but SELinux wouldn't allow us to know the detail. Really
+	 * w should just be given rights
+	 */
+	if(!kill(u->ut_pid, 0) || errno != ESRCH)
+		*found_utpid = 1;
 	return best ? best : secondbest;
 }
 
openSUSE Build Service is sponsored by