user-util: add new uid_is_system() helper
This adds uid_is_system() and gid_is_system(), similar in style to uid_is_dynamic(). That a helper like this is useful is illustrated by the fact that test-condition.c didn't get the check right so far, which this patch fixes.
This commit is contained in:
@@ -157,7 +157,7 @@ static int condition_test_user(Condition *c) {
|
||||
return id == getuid() || id == geteuid();
|
||||
|
||||
if (streq("@system", c->parameter))
|
||||
return getuid() <= SYSTEM_UID_MAX || geteuid() <= SYSTEM_UID_MAX;
|
||||
return uid_is_system(getuid()) || uid_is_system(geteuid());
|
||||
|
||||
username = getusername_malloc();
|
||||
if (!username)
|
||||
|
||||
Reference in New Issue
Block a user