aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2004-01-27 20:17:39 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2004-01-27 20:17:39 +0000
commitba6c3b6965197cecfa513c3ce34170b90209eb32 (patch)
tree5d70f728c0ead92057792fbed6e3837b8c1104c1 /libbb
parentfca35eb5add5fb3bbac61fd30ed151170f8fbedb (diff)
downloadbusybox-w32-ba6c3b6965197cecfa513c3ce34170b90209eb32.tar.gz
busybox-w32-ba6c3b6965197cecfa513c3ce34170b90209eb32.tar.bz2
busybox-w32-ba6c3b6965197cecfa513c3ce34170b90209eb32.zip
Teach busybox ps to get the correct uid when displaying stuff
git-svn-id: svn://busybox.net/trunk/busybox@8355 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r--libbb/procps.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libbb/procps.c b/libbb/procps.c
index 252e9c772..46e982766 100644
--- a/libbb/procps.c
+++ b/libbb/procps.c
@@ -54,6 +54,11 @@ extern procps_status_t * procps_scan(int save_user_arg0
54 pid = atoi(name); 54 pid = atoi(name);
55 curstatus.pid = pid; 55 curstatus.pid = pid;
56 56
57 sprintf(status, "/proc/%d", pid);
58 if(stat(status, &sb))
59 continue;
60 my_getpwuid(curstatus.user, sb.st_uid);
61
57 sprintf(status, "/proc/%d/stat", pid); 62 sprintf(status, "/proc/%d/stat", pid);
58 if((fp = fopen(status, "r")) == NULL) 63 if((fp = fopen(status, "r")) == NULL)
59 continue; 64 continue;
@@ -65,9 +70,6 @@ extern procps_status_t * procps_scan(int save_user_arg0
65 } 70 }
66 else 71 else
67#endif 72#endif
68 if(fstat(fileno(fp), &sb))
69 continue;
70 my_getpwuid(curstatus.user, sb.st_uid);
71 name = fgets(buf, sizeof(buf), fp); 73 name = fgets(buf, sizeof(buf), fp);
72 fclose(fp); 74 fclose(fp);
73 if(name == NULL) 75 if(name == NULL)