journald: move uid_for_system_journal() to uid-alloc-range.h
Let's move this helper call from journald specific code to src/basic/, so that we can use it from sd-journal. While we are at it, slightly extend it to also cover container uids, which are also routed to the system journal now. This places the call in uid-alloc-range.[ch] which contains similar functions that match UID ranges for specific purposes.
This commit is contained in:
@@ -122,3 +122,10 @@ bool gid_is_system(gid_t gid) {
|
||||
|
||||
return gid <= defs->system_gid_max;
|
||||
}
|
||||
|
||||
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 || uid_is_container(uid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user