Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190214163223.GS23599@brightrain.aerifal.cx>
Date: Thu, 14 Feb 2019 11:32:23 -0500
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: maybe a smaller HOST_NAME_MAX?

On Thu, Feb 14, 2019 at 04:59:05PM +0800, He X wrote:
> in limits.h, glibc defines it as 64, musl has a valueof 255.
> 
> according a man page:
> http://man7.org/linux/man-pages/man2/gethostname.2.html. HOST_NAME_MAX is
> defined as 64 since linux 1.0. include/uapi/asm-generic/param.h could
> verify that.
> 
> as musl targeted on linux-based devices, i think it makes sense to use a
> smaller HOST_NAME_MAX.

HOST_NAME_MAX>=255 is a POSIX requirement, and also a common-sense one
since it's the length of DNS hostnames. Linux defining it as 64 is a
historical bug. I'm not sure if the modern kernel interfaces let you
set a larger one or not, but from an API standpoint, applications need
to be prepared for the possibility of receiving a name up to the
standard length, not the buggy Linux limitation.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.