diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-12-02 13:07:18 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-12-06 13:40:50 +0100 |
commit | 834382779304c6f8b1994dcafaa748d798f533b6 (patch) | |
tree | bde810b1c900de4e824d85afef123d1f60baec56 /src/basic/user-util.h | |
parent | coredump,journal: do not do ACL magic for processes of dynamic UIDs (diff) | |
download | systemd-834382779304c6f8b1994dcafaa748d798f533b6.tar.xz systemd-834382779304c6f8b1994dcafaa748d798f533b6.zip |
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/basic/user-util.h')
-rw-r--r-- | src/basic/user-util.h | 4 |
1 files changed, 4 insertions, 0 deletions
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; } |