diff options
Diffstat (limited to 'libbb/procps.c')
-rw-r--r-- | libbb/procps.c | 14 |
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 @@ | |||
16 | 16 | ||
17 | #include "libbb.h" | 17 | #include "libbb.h" |
18 | 18 | ||
19 | extern procps_status_t * procps_scan(int save_user_arg0) | 19 | extern procps_status_t * procps_scan(int save_user_arg0 |
20 | #ifdef CONFIG_SELINUX | ||
21 | , int use_selinux , security_id_t *sid | ||
22 | #endif | ||
23 | ) | ||
20 | { | 24 | { |
21 | static DIR *dir; | 25 | static DIR *dir; |
22 | struct dirent *entry; | 26 | struct dirent *entry; |
@@ -53,6 +57,14 @@ extern procps_status_t * procps_scan(int save_user_arg0) | |||
53 | sprintf(status, "/proc/%d/stat", pid); | 57 | sprintf(status, "/proc/%d/stat", pid); |
54 | if((fp = fopen(status, "r")) == NULL) | 58 | if((fp = fopen(status, "r")) == NULL) |
55 | continue; | 59 | continue; |
60 | #ifdef CONFIG_SELINUX | ||
61 | if(use_selinux) | ||
62 | { | ||
63 | if(fstat_secure(fileno(fp), &sb, sid)) | ||
64 | continue; | ||
65 | } | ||
66 | else | ||
67 | #endif | ||
56 | if(fstat(fileno(fp), &sb)) | 68 | if(fstat(fileno(fp), &sb)) |
57 | continue; | 69 | continue; |
58 | my_getpwuid(curstatus.user, sb.st_uid); | 70 | my_getpwuid(curstatus.user, sb.st_uid); |