]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Subordinate IDs require 32bit uid_t/gid_t
authorNicolas François <nicolas.francois@centraliens.net>
Wed, 14 Aug 2013 18:21:32 +0000 (20:21 +0200)
committerNicolas François <nicolas.francois@centraliens.net>
Wed, 14 Aug 2013 18:22:15 +0000 (20:22 +0200)
* configure.in: Check if sizeof uid_t and gid_t is larger than 32
bit to support subordinate IDs.

ChangeLog
configure.in

index 73f74824da4e3f1fb420352a0588ad8cdf9dd973..de1f02bd2afa31c4e4d6a074a74505fb11e54d2d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-13  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * configure.in: Check if sizeof uid_t and gid_t is larger than 32
+       bit to support subordinate IDs.
+
 2013-08-13  Nicolas François  <nicolas.francois@centraliens.net>
 
        * lib/subordinateio.c: Avoid dead branches.
index d11a36497892ddeb74f758adeb3372421e9f66af..1a3f84185150338914748d61fe7e5575a9d01561 100644 (file)
@@ -244,7 +244,7 @@ AC_ARG_ENABLE(subordinate-ids,
        [AC_HELP_STRING([--enable-subordinate-ids],
                [support subordinate ids @<:@default=yes@:>@])],
        [enable_subids="${enableval}"],
-       [enable_subids="yes"]
+       [enable_subids="maybe"]
 )
 
 AC_ARG_WITH(audit, 
@@ -331,12 +331,28 @@ if test "$enable_man" = "yes"; then
 fi
 AM_CONDITIONAL(ENABLE_REGENERATE_MAN, test "x$enable_man" != "xno")
 
-if test "$enable_subids" = "yes"; then
+if test "$enable_subids" != "no"; then
        dnl
        dnl FIXME: check if 32 bit UIDs/GIDs are supported by libc
        dnl
-       AC_DEFINE(ENABLE_SUBIDS, 1, [Define to support the subordinate IDs.])
-       enable_subids="yes"
+       AC_RUN_IFELSE([AC_LANG_SOURCE([
+#include <sys/types.h>
+int main(void) {
+       uid_t u;
+       gid_t g;
+       return (sizeof u < 4) || (sizeof g < 4);
+}
+       ])], [id32bit="yes"], [id32bit="no"])
+
+       if test "x$id32bit" = "xyes"; then
+               AC_DEFINE(ENABLE_SUBIDS, 1, [Define to support the subordinate IDs.])
+               enable_subids="yes"
+       else
+               if test "x$enable_subids" = "xyes"; then
+                       AC_MSG_ERROR([Cannot enable support the subordinate IDs on systems where gid_t or uid_t has less than 32 bits])
+               fi
+               enable_subids="no"
+       fi
 fi
 AM_CONDITIONAL(ENABLE_SUBIDS, test "x$enable_subids" != "xno")