Launchpad has imported 5 comments from the remote bug at
http://sourceware.org/bugzilla/show_bug.cgi?id=10540.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2009-08-20T12:30:35+00:00 Steve Langasek wrote:

glibc 2.10 introduces a regression in getaddrinfo(); with a standard
nsswitch.conf:

$ grep host /etc/nsswitch.conf 
hosts:          files dns
$

and no /etc/hosts file on the system (which is legitimate; e.g., in a
chroot):

$ cat /etc/hosts
cat: /etc/hosts: No such file or directory
$

all calls to getaddrinfo() will fail, short-circuited by an nss_files failure
before invoking nss_dns.

Trivial test case, patch to follow.

Reply at: https://bugs.launchpad.net/glibc/+bug/408901/comments/9

------------------------------------------------------------------------
On 2009-08-20T12:32:19+00:00 Steve Langasek wrote:

Created attachment 4142
test case

Reply at: https://bugs.launchpad.net/glibc/+bug/408901/comments/10

------------------------------------------------------------------------
On 2009-08-20T12:34:32+00:00 Steve Langasek wrote:

Created attachment 4143
patch to nss_files fixing getaddrinfo when /etc/hosts is absent

Reply at: https://bugs.launchpad.net/glibc/+bug/408901/comments/11

------------------------------------------------------------------------
On 2009-10-30T05:05:33+00:00 Drepper-fsp wrote:

I applied the patch.

Reply at: https://bugs.launchpad.net/glibc/+bug/408901/comments/12

------------------------------------------------------------------------
On 2009-12-19T13:28:52+00:00 Hermier wrote:

Seems the fix is incorrect, on 2.11 I get:

bash-4.0# gcc bug-408901.c
bash-4.0# ./a.out www.redhat.com
www.redhat.com -5
bash-4.0# touch /etc/hosts
bash-4.0# ./a.out www.redhat.com
www.redhat.com 0

It seems that returning NO_DATA (in the patch) stops the host search
prematurely. Instead returning HOST_NOT_FOUND fix the issue, and sounds more
logical.

Reply at: https://bugs.launchpad.net/glibc/+bug/408901/comments/13


** Changed in: glibc
   Importance: Unknown => Medium

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/408901

Title:
  when /etc/hosts doesn't exist, apt fails to resolve hostnames using
  libc6

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to