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

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

 



On Fri, 26 May 2006, Ulrich Drepper wrote:

> 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.
>
It is written (on so-called compatible machines like my Sun) as:

#define MAXHOSTNAMELEN _POSIX_HOST_NAME_MAX

Then in limits.h, I see:

#define _POSIX_HOST_NAME_MAX 64

Since somebody uses "POSIX" in the define, I assumed it had something
to do with POSIX. Further review using google shows even 256 as the
minimum-maximum so it's likely something that is now biting lots
of people.

>
>> 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 ÿÿ
>
>

Cheers,
Dick Johnson
Penguin : Linux version 2.6.16.4 on an i686 machine (5592.73 BogoMips).
New book: http://www.AbominableFirebug.com/
_


****************************************************************
The information transmitted in this message is confidential and may be privileged.  Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited.  If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[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