From ea76157909ba9919cd0eb7535a7cb91c4c3fcb77 Mon Sep 17 00:00:00 2001 From: Duncan Overbruck Date: Thu, 21 Nov 2019 17:14:43 +0100 Subject: [PATCH] configure: make {UID,GID}_MAX configurable --- configure | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 95df243..2d20f09 100755 --- a/configure +++ b/configure @@ -29,6 +29,9 @@ usage: configure [options] --with-timestamp enable timestamp support + --uid-max=NUM set UID_MAX (default 65535) + --gid-max=NUM set GID_MAX (default 65535) + --help, -h display this help and exit EOF exit 0 @@ -36,6 +39,8 @@ EOF # defaults WITHOUT_TIMESTAMP=yes +UID_MAX=65535 +GID_MAX=65535 for x; do opt=${x%%=*} @@ -59,6 +64,8 @@ for x; do --without-shadow) WITHOUT_SHADOW=yes ;; --with-timestamp) WITHOUT_TIMESTAMP= ;; --without-timestamp) WITHOUT_TIMESTAMP=yes ;; + --uid-max) UID_MAX=$var ;; + --gid-max) UID_MAX=$var ;; --help|-h) usage ;; *) die "Error: unknown option $opt" ;; esac @@ -108,7 +115,7 @@ OS_CFLAGS="-D__${OS}__" case "$OS" in linux) - OS_CFLAGS="$OS_CFLAGS -D_DEFAULT_SOURCE -D_GNU_SOURCE -DUID_MAX=60000 -DGID_MAX=60000" + OS_CFLAGS="$OS_CFLAGS -D_DEFAULT_SOURCE -D_GNU_SOURCE -DUID_MAX=${UID_MAX} -DGID_MAX=${GID_MAX}" printf 'CURDIR := .\n' >>$CONFIG_MK [ -z "$WITHOUT_PAM" ] && \ printf 'PAM_DOAS = pam.d__doas__linux\n' >>$CONFIG_MK @@ -474,3 +481,5 @@ if [ $? -eq 0 ]; then else printf 'Using persist method\t\t\tnone.\n' >&2 fi +printf 'Setting UID_MAX\t\t\t\t%d.\n' "$UID_MAX" >&2 +printf 'Setting GID_MAX\t\t\t\t%d.\n' "$GID_MAX" >&2 -- 2.39.2