summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-12-02 12:59:21 +0100
committerLennart Poettering <lennart@poettering.net>2017-12-06 13:40:50 +0100
commitece877d434d3ef8ff096a6a130cfd28e6f643cd2 (patch)
treec1b46f31a9e317241abd4da8dd0607859e8064a4 /src/login
parent399725532df4aedc30119f920551bdbcbb01f13a (diff)
downloadsystemd-ece877d434d3ef8ff096a6a130cfd28e6f643cd2.tar.gz
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/login')
-rw-r--r--src/login/logind-user.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/login/logind-user.c b/src/login/logind-user.c
index 43a9f58adc..01469438b1 100644
--- a/src/login/logind-user.c
+++ b/src/login/logind-user.c
@@ -617,7 +617,7 @@ int user_finalize(User *u) {
* cases, as we shouldn't accidentally remove a system service's IPC objects while it is running, just because
* a cronjob running as the same user just finished. Hence: exclude system users generally from IPC clean-up,
* and do it only for normal users. */
- if (u->manager->remove_ipc && u->uid > SYSTEM_UID_MAX) {
+ if (u->manager->remove_ipc && !uid_is_system(u->uid)) {
k = clean_ipc_by_uid(u->uid);
if (k < 0)
r = k;