core: add @system special value to ConditionUser=
It allows checking if the user is a system user or a normal user
This commit is contained in:
@@ -154,6 +154,9 @@ static int condition_test_user(Condition *c) {
|
||||
if (r >= 0)
|
||||
return id == getuid() || id == geteuid();
|
||||
|
||||
if (streq("@system", c->parameter))
|
||||
return getuid() <= SYSTEM_UID_MAX || geteuid() <= SYSTEM_UID_MAX;
|
||||
|
||||
username = getusername_malloc();
|
||||
if (!username)
|
||||
return -ENOMEM;
|
||||
|
||||
Reference in New Issue
Block a user