Assume <utmpx.h> exists

It is required by POSIX.1-2001.

Cc: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar 2022-12-02 21:50:40 +01:00 committed by Serge Hallyn
parent 85d2688d62
commit b47aa1e9aa
2 changed files with 3 additions and 16 deletions

View File

@ -37,7 +37,7 @@ dnl Checks for libraries.
dnl Checks for header files. dnl Checks for header files.
AC_CHECK_HEADERS(crypt.h utmp.h \ AC_CHECK_HEADERS(crypt.h utmp.h \
utmpx.h termios.h termio.h sgtty.h sys/ioctl.h syslog.h paths.h \ termios.h termio.h sgtty.h sys/ioctl.h syslog.h paths.h \
utime.h ulimit.h sys/capability.h sys/random.h sys/resource.h \ utime.h ulimit.h sys/capability.h sys/random.h sys/resource.h \
gshadow.h lastlog.h rpc/key_prot.h netdb.h acl/libacl.h \ gshadow.h lastlog.h rpc/key_prot.h netdb.h acl/libacl.h \
attr/libattr.h attr/error_context.h) attr/libattr.h attr/error_context.h)

View File

@ -279,21 +279,8 @@ extern char *strdup ();
#endif #endif
/* Maximum length of usernames */ /* Maximum length of usernames */
#ifdef HAVE_UTMPX_H #include <utmpx.h>
# include <utmpx.h> #define USER_NAME_MAX_LENGTH (sizeof (((struct utmpx *)NULL)->ut_user))
# define USER_NAME_MAX_LENGTH (sizeof (((struct utmpx *)NULL)->ut_user))
#else
# include <utmp.h>
# ifdef HAVE_STRUCT_UTMP_UT_USER
# define USER_NAME_MAX_LENGTH (sizeof (((struct utmp *)NULL)->ut_user))
# else
# ifdef HAVE_STRUCT_UTMP_UT_NAME
# define USER_NAME_MAX_LENGTH (sizeof (((struct utmp *)NULL)->ut_name))
# else
# define USER_NAME_MAX_LENGTH 32
# endif
# endif
#endif
/* Maximum length of passwd entry */ /* Maximum length of passwd entry */
#define PASSWD_ENTRY_MAX_LENGTH 32768 #define PASSWD_ENTRY_MAX_LENGTH 32768