mirror of
https://github.com/sheumann/hush.git
synced 2025-01-15 18:30:43 +00:00
Teach busybox ps to get the correct uid when displaying stuff
This commit is contained in:
parent
82364bb591
commit
242ab83499
@ -54,6 +54,11 @@ extern procps_status_t * procps_scan(int save_user_arg0
|
|||||||
pid = atoi(name);
|
pid = atoi(name);
|
||||||
curstatus.pid = pid;
|
curstatus.pid = pid;
|
||||||
|
|
||||||
|
sprintf(status, "/proc/%d", pid);
|
||||||
|
if(stat(status, &sb))
|
||||||
|
continue;
|
||||||
|
my_getpwuid(curstatus.user, sb.st_uid);
|
||||||
|
|
||||||
sprintf(status, "/proc/%d/stat", pid);
|
sprintf(status, "/proc/%d/stat", pid);
|
||||||
if((fp = fopen(status, "r")) == NULL)
|
if((fp = fopen(status, "r")) == NULL)
|
||||||
continue;
|
continue;
|
||||||
@ -65,9 +70,6 @@ extern procps_status_t * procps_scan(int save_user_arg0
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
if(fstat(fileno(fp), &sb))
|
|
||||||
continue;
|
|
||||||
my_getpwuid(curstatus.user, sb.st_uid);
|
|
||||||
name = fgets(buf, sizeof(buf), fp);
|
name = fgets(buf, sizeof(buf), fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
if(name == NULL)
|
if(name == NULL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user