aboutsummaryrefslogtreecommitdiff
path: root/libbb/procps.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-07-03 10:07:04 +0000
committerEric Andersen <andersen@codepoet.org>2003-07-03 10:07:04 +0000
commit9e48045e45df7e3e205575a4eb3dc39d634b05aa (patch)
treee8f993dffc34380fbcc54cc858c81da594bdb95b /libbb/procps.c
parentc48d49ad988a4163cff7f38ee4bd1f9886d0ed11 (diff)
downloadbusybox-9e48045e45df7e3e205575a4eb3dc39d634b05aa.tar.gz
Patch from Russell Coker:
I've attached my latest SE Linux patch for busybox against the latest CVS version of busybox.
Diffstat (limited to 'libbb/procps.c')
-rw-r--r--libbb/procps.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libbb/procps.c b/libbb/procps.c
index 7df071869..44103fae8 100644
--- a/libbb/procps.c
+++ b/libbb/procps.c
@@ -16,7 +16,11 @@
#include "libbb.h"
-extern procps_status_t * procps_scan(int save_user_arg0)
+extern procps_status_t * procps_scan(int save_user_arg0
+#ifdef CONFIG_SELINUX
+ , int use_selinux , security_id_t *sid
+#endif
+ )
{
static DIR *dir;
struct dirent *entry;
@@ -53,6 +57,14 @@ extern procps_status_t * procps_scan(int save_user_arg0)
sprintf(status, "/proc/%d/stat", pid);
if((fp = fopen(status, "r")) == NULL)
continue;
+#ifdef CONFIG_SELINUX
+ if(use_selinux)
+ {
+ if(fstat_secure(fileno(fp), &sb, sid))
+ continue;
+ }
+ else
+#endif
if(fstat(fileno(fp), &sb))
continue;
my_getpwuid(curstatus.user, sb.st_uid);