Summary: | getaddrinfo() fails if /etc/hosts is missing, instead of falling through to nss_dns | ||
---|---|---|---|
Product: | glibc | Reporter: | Steve Langasek <vorlon> |
Component: | network | Assignee: | Ulrich Drepper <drepper.fsp> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | glibc-bugs |
Priority: | P2 | Flags: | fweimer:
security-
|
Version: | 2.10 | ||
Target Milestone: | --- | ||
Host: | x86_64-linux-gnu | Target: | x86_64-linux-gnu |
Build: | x86_64-linux-gnu | Last reconfirmed: | |
Attachments: |
test case
patch to nss_files fixing getaddrinfo when /etc/hosts is absent |
Description
Steve Langasek
2009-08-20 12:30:35 UTC
Created attachment 4142 [details]
test case
Created attachment 4143 [details]
patch to nss_files fixing getaddrinfo when /etc/hosts is absent
I applied the patch. 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. Appears to be working fine with 2.17. |