We use the same check at two places, let's add a tiny helper function
for it, since it's not entirely trivialy, and we changes this before
multiple times, and it's a good thing if we can change it at one place
only instead of multiple.
NULL);
}
+static bool uid_for_system_journal(uid_t uid) {
+
+ /* Returns true if the specified UID shall get its data stored in the system journal*/
+
+ return uid_is_system(uid) || uid_is_dynamic(uid) || uid == UID_NOBODY;
+}
+
static void server_add_acls(JournalFile *f, uid_t uid) {
#if HAVE_ACL
int r;
assert(f);
#if HAVE_ACL
- if (uid_is_system(uid) || uid_is_dynamic(uid) || uid == UID_NOBODY)
+ if (uid_for_system_journal(uid))
return;
r = add_acls_for_user(f->fd, uid);
if (s->runtime_journal)
return s->runtime_journal;
- if (uid_is_system(uid) || uid_is_dynamic(uid) || uid == UID_NOBODY)
+ if (uid_for_system_journal(uid))
return s->system_journal;
r = sd_id128_get_machine(&machine);