From: Alejandro Colomar Date: Tue, 22 Oct 2024 22:14:12 +0000 (+0200) Subject: src/login_nopam.c: Rely on the system's MAXHOSTNAMELEN X-Git-Tag: 4.17.0-rc1~30 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=19ce8b0abc9d280804987cfb06e0c14a4e1475c5;p=thirdparty%2Fshadow.git src/login_nopam.c: Rely on the system's MAXHOSTNAMELEN The reason for that code seems to be some ancient AIX version that defined a value that was too small (32). We don't support such systems. In the link below, I found the following comment and code: /* * Some AIX versions advertise a too small MAXHOSTNAMELEN value (32). * Result: long hostnames would be truncated, and connections would be * dropped because of host name verification failures. Adrian van Bloois * (A.vanBloois@info.nic.surfnet.nl) figured out what was the problem. */ #if (MAXHOSTNAMELEN < 64) #undef MAXHOSTNAMELEN #endif /* In case not defined in . */ #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 256 /* storage for host name */ #endif Today's systems seem to be much better regarding this macro. Rely on them. Link: Signed-off-by: Alejandro Colomar --- diff --git a/src/login_nopam.c b/src/login_nopam.c index 5c0ecc0e8..2d979323e 100644 --- a/src/login_nopam.c +++ b/src/login_nopam.c @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include /* for inet_ntoa() */ @@ -61,11 +62,6 @@ #include "string/strtok/stpsep.h" -#if !defined(MAXHOSTNAMELEN) || (MAXHOSTNAMELEN < 64) -#undef MAXHOSTNAMELEN -#define MAXHOSTNAMELEN 256 -#endif - /* Path name of the access control file. */ #ifndef TABLE #define TABLE "/etc/login.access"