]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Assume <utmpx.h> exists
authorAlejandro Colomar <alx@kernel.org>
Fri, 2 Dec 2022 20:50:40 +0000 (21:50 +0100)
committerSerge Hallyn <serge@hallyn.com>
Thu, 15 Dec 2022 22:22:05 +0000 (16:22 -0600)
It is required by POSIX.1-2001.

Cc: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
configure.ac
lib/defines.h

index a534fc03ee0fc68ecde65d798eeb185335c86ea9..185b85cb822280660af6426a183b51e21b977c64 100644 (file)
@@ -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)
index db3adb3f874b36b9314f1c777e9ac73e22d1c786..4be6ecb34b4cf1e95796d36e1da14ffa34859dab 100644 (file)
@@ -279,21 +279,8 @@ extern char *strdup ();
 #endif
 
 /* Maximum length of usernames */
-#ifdef HAVE_UTMPX_H
-# include <utmpx.h>
-# 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
+#include <utmpx.h>
+#define USER_NAME_MAX_LENGTH (sizeof (((struct utmpx *)NULL)->ut_user))
 
 /* Maximum length of passwd entry */
 #define PASSWD_ENTRY_MAX_LENGTH 32768