Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/login_nopam.c: Rely on the system's MAXHOSTNAMELEN #1100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alejandro-colomar
Copy link
Collaborator

@alejandro-colomar alejandro-colomar commented Oct 22, 2024

The reason for that code seems to be some ancient AIX versions 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
	  * ([email protected]) 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


Revisions:

v1b
  • Rebase
$ git range-diff master..gh/maxhostnamelen shadow/master..maxhostnamelen 
1:  55ba5be3 = 1:  ba79bdeb src/login_nopam.c: Rely on the system's MAXHOSTNAMELEN
v2
  • Several rebases
$ git range-diff ba79bdeb^..ba79bdeb shadow/master..gh/maxhostnamelen 
1:  ba79bdeb = 1:  c0cb9655 src/login_nopam.c: Rely on the system's MAXHOSTNAMELEN

@alejandro-colomar alejandro-colomar added the Simpler A good issue for a new beginner label Oct 26, 2024
@alejandro-colomar alejandro-colomar force-pushed the maxhostnamelen branch 3 times, most recently from c2f9ee4 to 4065295 Compare November 1, 2024 20:27
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
	  * ([email protected]) 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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Simpler A good issue for a new beginner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant