From 19ce8b0abc9d280804987cfb06e0c14a4e1475c5 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 23 Oct 2024 00:14:12 +0200 Subject: [PATCH] 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 --- src/login_nopam.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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" -- 2.47.2