← Commit list

242ab8349

Eric Andersen
Eric Andersen
2004-01-27
FAILED Duration: 68s

Subject

Teach busybox ps to get the correct uid when displaying stuff

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

libbb/procps.c+5 -3
@@ -54,6 +54,11 @@ extern procps_status_t * procps_scan(int save_user_arg0
pid = atoi(name);
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);
if((fp = fopen(status, "r")) == NULL)
continue;
@@ -65,9 +70,6 @@ extern procps_status_t * procps_scan(int save_user_arg0
}
else
#endif
- if(fstat(fileno(fp), &sb))
- continue;
- my_getpwuid(curstatus.user, sb.st_uid);
name = fgets(buf, sizeof(buf), fp);
fclose(fp);
if(name == NULL)