Re: [PATCH] POSIX-hostname up to 255 characters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



linux-os (Dick Johnson) wrote:

> MAXHOSTNAMELEN, defined by POSIX, is 64 bytes.

Where do you think this is written?  The minimum maximum for the host
name length in POSIX is 255.  This is the whole motivation of the patch.
 Linux currently cannot conform because this is one of the things the
kernel gets wrong.


> You can't just
> change it to 255. If you did, all servers in the universe, all
> everything would have to be shutdown, recompiled, and rebooted
> simultaneously. You can't have a name-server returning a 255-byte
> string when a mail-server can only handle 64 bytes.

The hostname is a machine-local value.  How the machine is represented
to the outside world is governed by services like DNS.  DNS defines its
own limits on the length of the name and each component.  So, if a host
name (without domain) exceeds 64 bytes you need a different external
name for the machine.  But this doesn't stop anybody from locally using
a longer name.

Can there be programs which have problems?  Certainly.  But
gethostname() won't just overwrite memory.  It'll return an error and
the programs with the wrong assumptions can be fix.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux