]> git.ipfire.org Git - thirdparty/shadow.git/commit
src/login_nopam.c: Rely on the system's MAXHOSTNAMELEN
authorAlejandro Colomar <alx@kernel.org>
Tue, 22 Oct 2024 22:14:12 +0000 (00:14 +0200)
committerSerge Hallyn <serge@hallyn.com>
Mon, 11 Nov 2024 05:17:41 +0000 (23:17 -0600)
commit19ce8b0abc9d280804987cfb06e0c14a4e1475c5
tree043ba9efa173827c1d3108d0d369507c19a309b1
parent9d8145acfc7eba688387c7d3ac4494d39056b30b
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>
src/login_nopam.c