psmisc/psmisc-22.20-fix-selinux-in-pstree.patch
Richard W.M. Jones 006b356a9b Update to 22.20.
- Contains a fix for: http://sourceforge.net/p/psmisc/bugs/53/
- Fix src/pstree.c when SELinux is available.
2012-10-08 19:20:22 +01:00

40 lines
1.0 KiB
Diff

--- psmisc-22.20/src/pstree.c 2012-09-19 14:05:43.000000000 +0100
+++ psmisc-22.20-selinux/src/pstree.c 2012-10-08 19:18:13.992951873 +0100
@@ -140,7 +140,12 @@
static int dumped = 0; /* used by dump_by_user */
static int charlen = 0; /* length of character */
+#ifdef WITH_SELINUX
+static void fix_orphans(security_context_t scontext);
+#else
static void fix_orphans(void);
+#endif
+
/*
* Allocates additional buffer space for width and more as needed.
* The first call will allocate the first buffer.
@@ -787,7 +792,11 @@
}
}
(void) closedir(dir);
+#ifdef WITH_SELINUX
+ fix_orphans(scontext);
+#else
fix_orphans();
+#endif
if (print_args)
free(buffer);
if (empty) {
@@ -796,7 +805,11 @@
}
}
+#ifdef WITH_SELINUX
+static void fix_orphans(security_context_t scontext)
+#else
static void fix_orphans(void)
+#endif
{
/* When using kernel 3.3 with hidepid feature enabled on /proc
* then we need fake root pid and gather all the orphan processes