procps/procps-ng-3.3.8-selinux.patch
2013-05-29 13:55:21 +00:00

69 lines
2.0 KiB
Diff

--- 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/output.c
+++ ps/output.c 2013-05-29 11:02:06.109939431 +0000
@@ -1282,6 +1282,7 @@ fail:
/****************** FLASK & seLinux security stuff **********************/
// move the bulk of this to libproc sometime
+#if 0
static int pr_context(char *restrict const outbuf, const proc_t *restrict const pp){
char filename[48];
size_t len;
@@ -1310,7 +1311,7 @@ fail:
return 1;
}
-#if 0
+#else
// This needs more study, considering:
// 1. the static linking option (maybe disable this in that case)
// 2. the -z and -Z option issue
--- 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;
}