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 <sys/param.h>. */

	#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: <https://sources.debian.org/src/tcp-wrappers/7.6.q-33/workarounds.c/?hl=36#L36>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar
2024-11-10 23:17:41 -06:00
committed by Serge Hallyn
parent 9d8145acfc
commit 19ce8b0abc
+1 -5
View File
@@ -52,6 +52,7 @@
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h> /* 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"