test: allow to allocate test scope even running with unprivileged user
This commit is contained in:
+4
-1
@@ -219,7 +219,10 @@ static int allocate_scope(void) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = sd_bus_default_system(&bus);
|
||||
if (geteuid() == 0)
|
||||
r = sd_bus_default_system(&bus);
|
||||
else
|
||||
r = sd_bus_default_user(&bus);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to connect to system bus: %m");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user