diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-09-25 13:56:13 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-09-25 17:18:56 +0200 |
commit | 98dcb8f4c79e0e1685098c3b618719c176b113d2 (patch) | |
tree | ca5cb3f3eeeeafd8e236f00c5fbc98751106be29 /src/basic/user-util.h | |
parent | 960b585ba116cc09055d3f5540a0c73e088d37e4 (diff) | |
download | systemd-98dcb8f4c79e0e1685098c3b618719c176b113d2.tar.gz |
Move {uid,gid}_is_*() from basic to shared
Those are functions that express policy, and nothing in basic/ uses
(or should use) them.
Diffstat (limited to 'src/basic/user-util.h')
-rw-r--r-- | src/basic/user-util.h | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/src/basic/user-util.h b/src/basic/user-util.h index 7c142dd1e6..13e2c99e6c 100644 --- a/src/basic/user-util.h +++ b/src/basic/user-util.h @@ -3,7 +3,7 @@ #include <grp.h> #if ENABLE_GSHADOW -#include <gshadow.h> +# include <gshadow.h> #endif #include <pwd.h> #include <shadow.h> @@ -61,30 +61,6 @@ int take_etc_passwd_lock(const char *root); #define ETC_PASSWD_LOCK_PATH "/etc/.pwd.lock" -static inline bool uid_is_system(uid_t uid) { - return uid <= SYSTEM_UID_MAX; -} - -static inline bool gid_is_system(gid_t gid) { - return gid <= SYSTEM_GID_MAX; -} - -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_container(uid_t uid) { - return CONTAINER_UID_BASE_MIN <= uid && uid <= CONTAINER_UID_BASE_MAX; -} - -static inline bool gid_is_container(gid_t gid) { - return uid_is_container((uid_t) gid); -} - /* The following macros add 1 when converting things, since UID 0 is a valid UID, while the pointer * NULL is special */ #define PTR_TO_UID(p) ((uid_t) (((uintptr_t) (p))-1)) |