summaryrefslogtreecommitdiff
path: root/src/nss-systemd
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-12-02 13:07:18 +0100
committerLennart Poettering <lennart@poettering.net>2017-12-06 13:40:50 +0100
commit834382779304c6f8b1994dcafaa748d798f533b6 (patch)
treebde810b1c900de4e824d85afef123d1f60baec56 /src/nss-systemd
parent4e72397b00ab23607635ce6725573554f235101a (diff)
downloadsystemd-834382779304c6f8b1994dcafaa748d798f533b6.tar.gz
nss-systemd: tweak checks when we consult PID 1 for dynamic UID/GID lookups
Instead of contacting PID 1 for dynamic UID/GID lookups for all UIDs/GIDs that do not qualify as "system" do the more precise check instead: check if they actually qualify for the "dynamic" range.
Diffstat (limited to 'src/nss-systemd')
-rw-r--r--src/nss-systemd/nss-systemd.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nss-systemd/nss-systemd.c b/src/nss-systemd/nss-systemd.c
index d1a369672e..1852cf41cb 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_is_system(uid))
+ if (!uid_is_dynamic(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_is_system(gid))
+ if (!gid_is_dynamic(gid))
goto not_found;
if (getenv_bool_secure("SYSTEMD_NSS_DYNAMIC_BYPASS") > 0)
@@ -500,7 +500,6 @@ enum nss_status _nss_systemd_getgrgid_r(
direct_lookup:
if (bypass > 0) {
-
r = direct_lookup_uid(gid, &direct);
if (r == -ENOENT)
goto not_found;