Index | Thread | Search

From:
"Theo de Raadt" <deraadt@openbsd.org>
Subject:
Re: smtpd: spell HOST_NAME_MAX differently (for -portable)
To:
tech@openbsd.org
Date:
Tue, 20 Aug 2024 09:42:49 -0600

Download raw body.

Thread
Claus Assmann <ca+OpenBSD_tech@esmtp.org> wrote:

> Just for the fun of it - sendmail has this:
> 
> # if defined(__linux__) && MAXHOSTNAMELEN < 255
>    /*
>    **  override Linux weirdness: a FQHN can be 255 chars long
>    **  SUSv3 requires HOST_NAME_MAX ("Maximum length of a host
>    **  name (not including the terminating null) as returned from the
>    **  gethostname() function.") to be at least 255.  c.f.:
>    **  http://www.opengroup.org/onlinepubs/009695399
>    **  but Linux defines that to 64 too.
>    */
> #  undef MAXHOSTNAMELEN
> #  define MAXHOSTNAMELEN	256
> # endif /* defined(__linux__) && MAXHOSTNAMELEN < 255 */

It's all fun and games until you round-trip one of those long names into
a library that doesn't expect it.  Now you own the problem that
occurs there....