mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-23 17:34:00 +03:00
test-process-util: do not assume PID 1 has UID=0
Gentoo's Portage package manager uses a PID namespace for process isolation and cleanup. In this namespace, PID 1 has UID=250 (portage). Bug: https://bugs.gentoo.org/674458
This commit is contained in:
parent
78218e6243
commit
f356aabe98
@ -70,11 +70,9 @@ static void test_get_process_comm(pid_t pid) {
|
||||
|
||||
assert_se(get_process_uid(pid, &u) == 0);
|
||||
log_info("PID"PID_FMT" UID: "UID_FMT, pid, u);
|
||||
assert_se(u == 0 || pid != 1);
|
||||
|
||||
assert_se(get_process_gid(pid, &g) == 0);
|
||||
log_info("PID"PID_FMT" GID: "GID_FMT, pid, g);
|
||||
assert_se(g == 0 || pid != 1);
|
||||
|
||||
r = get_process_environ(pid, &env);
|
||||
assert_se(r >= 0 || r == -EACCES);
|
||||
|
Loading…
Reference in New Issue
Block a user