diff --git a/config.h.in b/config.h.in index acf033a11..9a5b9eaad 100644 --- a/config.h.in +++ b/config.h.in @@ -1306,6 +1306,9 @@ /* The size of 'time_t', as computed by sizeof. */ #undef SIZEOF_TIME_T +/* The size of 'uid_t', as computed by sizeof. */ +#undef SIZEOF_UID_T + /* Define to 1 to compile the sudoers plugin statically into the sudo binary. */ #undef STATIC_SUDOERS_PLUGIN diff --git a/configure b/configure index 422505653..d71f38dbf 100755 --- a/configure +++ b/configure @@ -21011,6 +21011,46 @@ printf "%s\n" "$ac_cv_sizeof_time_t" >&6; } printf "%s\n" "#define SIZEOF_TIME_T $ac_cv_sizeof_time_t" >>confdefs.h +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of uid_t" >&5 +printf %s "checking size of uid_t... " >&6; } +if test ${ac_cv_sizeof_uid_t+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uid_t))" "ac_cv_sizeof_uid_t" "$ac_includes_default" +then : + +else case e in #( + e) if test "$ac_cv_type_uid_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (uid_t) +See 'config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_uid_t=0 + fi ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_uid_t" >&5 +printf "%s\n" "$ac_cv_sizeof_uid_t" >&6; } + + + +printf "%s\n" "#define SIZEOF_UID_T $ac_cv_sizeof_uid_t" >>confdefs.h + + +# sudo current assumes uid_t can be cast to unsigned int without problems +if test $ac_cv_sizeof_uid_t -gt 4 +then : + as_fn_error $? "sudo does not support systems where uid_t is larger than 32-bit" "$LINENO" 5 +fi if test X"$ac_cv_header_utmps_h" = X"yes" then : diff --git a/configure.ac b/configure.ac index 0bb369fa0..349f4b279 100644 --- a/configure.ac +++ b/configure.ac @@ -2507,6 +2507,9 @@ AC_CHECK_SIZEOF([long]) AC_CHECK_SIZEOF([long long]) AC_CHECK_SIZEOF([id_t]) AC_CHECK_SIZEOF([time_t]) +AC_CHECK_SIZEOF([uid_t]) +# sudo current assumes uid_t can be cast to unsigned int without problems +AS_IF([test $ac_cv_sizeof_uid_t -gt 4], [AC_MSG_ERROR([sudo does not support systems where uid_t is larger than 32-bit])]) AS_IF([test X"$ac_cv_header_utmps_h" = X"yes"], [ SUDO_CHECK_UTMP_MEMBERS([utmps]) ], [test X"$ac_cv_header_utmpx_h" = X"yes"], [