build-sys: make the dynamic UID range, and the container UID range configurable

Also, export these ranges in our pkg-config files.
This commit is contained in:
Lennart Poettering
2017-12-06 12:55:37 +01:00
parent 6a483c5b2f
commit 87d5e4f286
6 changed files with 39 additions and 18 deletions
-7
View File
@@ -60,13 +60,6 @@ int take_etc_passwd_lock(const char *root);
#define UID_INVALID ((uid_t) -1)
#define GID_INVALID ((gid_t) -1)
/* Let's pick a UIDs within the 16bit range, so that we are compatible with containers using 16bit
* user namespacing. At least on Fedora normal users are allocated until UID 60000, hence do not
* allocate from below this. Also stay away from the upper end of the range as that is often used
* for overflow/nobody users. */
#define DYNAMIC_UID_MIN ((uid_t) UINT32_C(0x0000EF00))
#define DYNAMIC_UID_MAX ((uid_t) UINT32_C(0x0000FFEF))
static inline bool uid_is_dynamic(uid_t uid) {
return DYNAMIC_UID_MIN <= uid && uid <= DYNAMIC_UID_MAX;
}