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:
Lennart Poettering
2017-12-06 13:40:50 +01:00
parent 399725532d
commit ece877d434
7 changed files with 16 additions and 8 deletions
+1 -1
View File
@@ -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)