Debian Bug report logs -
#482973
libc6: gethostbyname() fails on IPv4 addresses with hex components
Reply or subscribe to this bug.
Toggle useless messages
Report forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#482973; Package libc6.
(full text, mbox, link).
Acknowledgement sent to Stephane Chazelas <stephane_chazelas@yahoo.fr>:
New Bug report received and forwarded. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>.
(full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
Package: libc6
Version: 2.7-11
Severity: normal
gethostbyname() fails with an "unknown host" error for IP
addresses with hexadecimal components in them. decimal and octal
components are OK.
For instace, 0x7F.1 which is another way to represent 127.0.0.1
fails. 0177.1 is OK.
That breaks POSIX conformance. As per POSIX, gethostbyname()
should recognise the same IPv4 address notations as inet_addr().
The spec for inet_addr() gives:
a.b.c.d
When four parts are specified, each shall be interpreted as
a byte of data and assigned, from left to right, to the four
bytes of an Internet address.
a.b.c
When a three-part address is specified, the last part shall
be interpreted as a 16-bit quantity and placed in the
rightmost two bytes of the network address. This makes the
three-part address format convenient for specifying Class B
network addresses as "128.net.host".
a.b
When a two-part address is supplied, the last part shall be
interpreted as a 24-bit quantity and placed in the rightmost
three bytes of the network address. This makes the two-part
address format convenient for specifying Class A network
addresses as "net.host".
a
When only one part is given, the value shall be stored
directly in the network address without any byte
rearrangement.
All numbers supplied as parts in IPv4 dotted decimal notation
may be decimal, octal, or hexadecimal, as specified in the ISO C
standard (that is, a leading 0x or 0X implies hexadecimal;
otherwise, a leading '0' implies octal; otherwise, the number is
interpreted as decimal).
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.25-rc8 (PREEMPT)
Locale: LANG=en_GB.ISO-8859-15, LC_CTYPE=en_US.ISO-8859-15 (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/bash
Versions of packages libc6 depends on:
ii libgcc1 1:4.3.0-4 GCC support library
libc6 recommends no packages.
-- debconf-show failed
Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#482973; Package libc6.
(full text, mbox, link).
Acknowledgement sent to Clint Adams <schizo@debian.org>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>.
(full text, mbox, link).
Message #10 received at 482973@bugs.debian.org (full text, mbox, reply):
On Mon, May 26, 2008 at 11:10:46AM +0100, Stephane Chazelas wrote:
> That breaks POSIX conformance. As per POSIX, gethostbyname()
> should recognise the same IPv4 address notations as inet_addr().
> The spec for inet_addr() gives:
Technically, POSIX marks it as Obsolescent and says that you shall not
use it, so I don't know if you can make that claim.
Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#482973; Package libc6.
(full text, mbox, link).
Acknowledgement sent to "Michael Kerrisk" <mtk.manpages@googlemail.com>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>.
(full text, mbox, link).
Message #15 received at 482973@bugs.debian.org (full text, mbox, reply):
On Wed, May 28, 2008 at 9:07 PM, Clint Adams <schizo@debian.org> wrote:
> On Mon, May 26, 2008 at 11:10:46AM +0100, Stephane Chazelas wrote:
>> That breaks POSIX conformance. As per POSIX, gethostbyname()
>> should recognise the same IPv4 address notations as inet_addr().
>> The spec for inet_addr() gives:
>
> Technically, POSIX marks it as Obsolescent and says that you shall not
> use it, so I don't know if you can make that claim.
Sorry, but that is not right. The fact that an interface is marked as
obsolescent has no relevance as to whether it should conform to
specified behavior.
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Thu Mar 9 10:04:20 2023;
Machine Name:
buxtehude
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.