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
+2 -2
View File
@@ -251,7 +251,7 @@ enum nss_status _nss_systemd_getpwuid_r(
}
}
if (uid <= SYSTEM_UID_MAX)
if (uid_is_system(uid))
goto not_found;
if (getenv_bool_secure("SYSTEMD_NSS_DYNAMIC_BYPASS") > 0)
@@ -463,7 +463,7 @@ enum nss_status _nss_systemd_getgrgid_r(
}
}
if (gid <= SYSTEM_GID_MAX)
if (gid_is_system(gid))
goto not_found;
if (getenv_bool_secure("SYSTEMD_NSS_DYNAMIC_BYPASS") > 0)