udev: String substitutions can be done in ENV, too
[systemd_ALT.git] / src / basic / uid-alloc-range.h
blob5badde148a564daf3dee56d4f31bc3b16c84ce7e
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
4 #include <stdbool.h>
5 #include <sys/types.h>
7 bool uid_is_system(uid_t uid);
8 bool gid_is_system(gid_t gid);
10 static inline bool uid_is_dynamic(uid_t uid) {
11 return DYNAMIC_UID_MIN <= uid && uid <= DYNAMIC_UID_MAX;
14 static inline bool gid_is_dynamic(gid_t gid) {
15 return uid_is_dynamic((uid_t) gid);
18 static inline bool uid_is_container(uid_t uid) {
19 return CONTAINER_UID_BASE_MIN <= uid && uid <= CONTAINER_UID_BASE_MAX;
22 static inline bool gid_is_container(gid_t gid) {
23 return uid_is_container((uid_t) gid);
26 typedef struct UGIDAllocationRange {
27 uid_t system_alloc_uid_min;
28 uid_t system_uid_max;
29 gid_t system_alloc_gid_min;
30 gid_t system_gid_max;
31 } UGIDAllocationRange;
33 int read_login_defs(UGIDAllocationRange *ret_defs, const char *path, const char *root);
34 const UGIDAllocationRange *acquire_ugid_allocation_range(void);
36 bool uid_for_system_journal(uid_t uid);