diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-12-02 12:59:21 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-12-06 13:40:50 +0100 |
commit | ece877d434d3ef8ff096a6a130cfd28e6f643cd2 (patch) | |
tree | c1b46f31a9e317241abd4da8dd0607859e8064a4 /src/nss-systemd/nss-systemd.c | |
parent | doc: add a document briefly explaining UID/GID range assumptions we make (diff) | |
download | systemd-ece877d434d3ef8ff096a6a130cfd28e6f643cd2.tar.xz systemd-ece877d434d3ef8ff096a6a130cfd28e6f643cd2.zip |
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.
Diffstat (limited to 'src/nss-systemd/nss-systemd.c')
-rw-r--r-- | src/nss-systemd/nss-systemd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nss-systemd/nss-systemd.c b/src/nss-systemd/nss-systemd.c index d6de0a9878..d1a369672e 100644 --- a/src/nss-systemd/nss-systemd.c +++ b/src/nss-systemd/nss-systemd.c @@ -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) |