summaryrefslogtreecommitdiffstats
path: root/src/basic/user-util.h
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/basic/user-util.h
parentcoredump,journal: do not do ACL magic for processes of dynamic UIDs (diff)
downloadsystemd-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.h4
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;
}