diff options
author | Eric Andersen <andersen@codepoet.org> | 2004-01-27 20:17:39 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2004-01-27 20:17:39 +0000 |
commit | 242ab8349995f97807896835a6c680d57567aa1a (patch) | |
tree | 5d70f728c0ead92057792fbed6e3837b8c1104c1 | |
parent | 82364bb59100c690a5cdee308da990577b91fe5a (diff) | |
download | busybox-w32-242ab8349995f97807896835a6c680d57567aa1a.tar.gz busybox-w32-242ab8349995f97807896835a6c680d57567aa1a.tar.bz2 busybox-w32-242ab8349995f97807896835a6c680d57567aa1a.zip |
Teach busybox ps to get the correct uid when displaying stuff
-rw-r--r-- | libbb/procps.c | 8 |
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) |