From b47aa1e9aaf4690c67cb325af126c0b18dcfaad6 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Fri, 2 Dec 2022 21:50:40 +0100 Subject: [PATCH] Assume exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is required by POSIX.1-2001. Cc: Christian Göttsche Signed-off-by: Alejandro Colomar --- configure.ac | 2 +- lib/defines.h | 17 ++--------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index a534fc03..185b85cb 100644 --- a/configure.ac +++ b/configure.ac @@ -37,7 +37,7 @@ dnl Checks for libraries. dnl Checks for header files. 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 \ gshadow.h lastlog.h rpc/key_prot.h netdb.h acl/libacl.h \ attr/libattr.h attr/error_context.h) diff --git a/lib/defines.h b/lib/defines.h index db3adb3f..4be6ecb3 100644 --- a/lib/defines.h +++ b/lib/defines.h @@ -279,21 +279,8 @@ extern char *strdup (); #endif /* Maximum length of usernames */ -#ifdef HAVE_UTMPX_H -# include -# define USER_NAME_MAX_LENGTH (sizeof (((struct utmpx *)NULL)->ut_user)) -#else -# include -# 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 +#include +#define USER_NAME_MAX_LENGTH (sizeof (((struct utmpx *)NULL)->ut_user)) /* Maximum length of passwd entry */ #define PASSWD_ENTRY_MAX_LENGTH 32768