Debian Bug report logs - #482973
libc6: gethostbyname() fails on IPv4 addresses with hex components

version graph

Package: libc6; Maintainer for libc6 is GNU Libc Maintainers <debian-glibc@lists.debian.org>; Source for libc6 is src:eglibc.

Reported by: Stephane Chazelas <stephane_chazelas@yahoo.fr>

Date: Mon, 26 May 2008 10:12:01 UTC

Severity: normal

Found in version glibc/2.7-11

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#482973; Package libc6. Full text and rfc822 format available.

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 and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Stephane Chazelas <stephane_chazelas@yahoo.fr>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: libc6: gethostbyname() fails on IPv4 addresses with hex components
Date: Mon, 26 May 2008 11:10:46 +0100
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 and rfc822 format available.

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 and rfc822 format available.

Message #10 received at 482973@bugs.debian.org (full text, mbox):

From: Clint Adams <schizo@debian.org>
To: Stephane Chazelas <stephane_chazelas@yahoo.fr>, 482973@bugs.debian.org
Subject: Re: Bug#482973: libc6: gethostbyname() fails on IPv4 addresses with hex components
Date: Wed, 28 May 2008 19:07:41 +0000
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 and rfc822 format available.

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 and rfc822 format available.

Message #15 received at 482973@bugs.debian.org (full text, mbox):

From: "Michael Kerrisk" <mtk.manpages@googlemail.com>
To: "Clint Adams" <schizo@debian.org>, 482973@bugs.debian.org
Cc: "Stephane Chazelas" <stephane_chazelas@yahoo.fr>
Subject: Re: Bug#482973: libc6: gethostbyname() fails on IPv4 addresses with hex components
Date: Wed, 28 May 2008 21:22:02 +0200
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: Sun Apr 20 16:24:35 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.