mirror of
https://github.com/systemd/systemd.git
synced 2024-11-27 20:23:36 +08:00
tests: make "test-execute" work in "sudo ninja -C build test" (#7463)
In this mode USER/LOGNAME still point to the original caller, and our tests get confused by that. Follow-up for: #7450
This commit is contained in:
parent
3d22bc8636
commit
2482f88d2a
@ -560,6 +560,9 @@ int main(int argc, char *argv[]) {
|
||||
log_parse_environment();
|
||||
log_open();
|
||||
|
||||
(void) unsetenv("USER");
|
||||
(void) unsetenv("LOGNAME");
|
||||
|
||||
/* It is needed otherwise cgroup creation fails */
|
||||
if (getuid() != 0) {
|
||||
puts("Skipping test: not root");
|
||||
|
Loading…
Reference in New Issue
Block a user