From 834382779304c6f8b1994dcafaa748d798f533b6 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 2 Dec 2017 13:07:18 +0100 Subject: 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. --- src/basic/user-util.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/basic/user-util.h') diff --git a/src/basic/user-util.h b/src/basic/user-util.h index 6de68e2d2c..d148d5819e 100644 --- a/src/basic/user-util.h +++ b/src/basic/user-util.h @@ -64,6 +64,10 @@ static inline bool uid_is_dynamic(uid_t uid) { return DYNAMIC_UID_MIN <= uid && uid <= DYNAMIC_UID_MAX; } +static inline bool gid_is_dynamic(gid_t gid) { + return uid_is_dynamic((uid_t) gid); +} + static inline bool uid_is_system(uid_t uid) { return uid <= SYSTEM_UID_MAX; } -- cgit v1.2.3