don't trust UID_MAX or MAXUID

This commit is contained in:
Todd C. Miller
1998-10-22 01:00:27 +00:00
parent ce733cd8f7
commit 1f94c6b388

14
aclocal.m4 vendored
View File

@@ -269,8 +269,8 @@ fi
dnl dnl
dnl check for max length of uid_t in string representation. dnl check for max length of uid_t in string representation.
dnl if MAXUID exists there is no real way to see if uid_t is dnl we can't really trust UID_MAX or MAXUID since they may exist
dnl signed or not so we add one on the off chance that it is. dnl only for backwards compatibility.
dnl dnl
AC_DEFUN(SUDO_UID_T_LEN, AC_DEFUN(SUDO_UID_T_LEN,
[AC_REQUIRE([AC_TYPE_UID_T]) [AC_REQUIRE([AC_TYPE_UID_T])
@@ -285,16 +285,8 @@ AC_TRY_RUN(
#include <sys/param.h> #include <sys/param.h>
main() { main() {
FILE *f; FILE *f;
char b[BUFSIZ]; char b[1024];
#ifdef UID_MAX
uid_t u = UID_MAX;
#else
# ifdef MAXUID
uid_t u = MAXUID;
# else
uid_t u = (uid_t) -1; uid_t u = (uid_t) -1;
# endif
#endif
if ((f = fopen("conftestdata", "w")) == NULL) if ((f = fopen("conftestdata", "w")) == NULL)
exit(1); exit(1);