chiark / gitweb /
user-util: add UID_NOBODY defines that resolve to (uid_t) 65534
authorLennart Poettering <lennart@poettering.net>
Mon, 4 Dec 2017 16:06:56 +0000 (17:06 +0100)
committerSven Eden <yamakuzure@gmx.net>
Mon, 4 Dec 2017 16:06:56 +0000 (17:06 +0100)
We use it all over the place, let's add a #define for it. Makes things
easier greppable, and more explanatory I think.

src/basic/user-util.h

index d97f4821aebae6f3af7ecc923fc055d107ce0ffd..a61c0bff7494708bcfa473c84a66944aa18d9b5e 100644 (file)
@@ -67,6 +67,9 @@ int take_etc_passwd_lock(const char *root);
 #define UID_INVALID ((uid_t) -1)
 #define GID_INVALID ((gid_t) -1)
 
+#define UID_NOBODY ((uid_t) 65534U)
+#define GID_NOBODY ((gid_t) 65534U)
+
 static inline bool uid_is_dynamic(uid_t uid) {
         return DYNAMIC_UID_MIN <= uid && uid <= DYNAMIC_UID_MAX;
 }