This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/1912] New: gethostbyname2()/getaddrinfo() skips /etc/hosts with --enable-static-nss


When built with --enable-static-nss, gethostbyname2() and functions that call 
it like getaddrinfo() will only do dns lookups and not try /etc/hosts like
gethostbyname() will.

__nss_lookup_function() for gethostbyname2() will try _nss_dns_gethostbyname2_r,
but not _nss_files_gethostbyname2_r.

I'm using an old 2.2.x version, but it appears missing in the code for 2.3.5 as
well.

Below patch will fix the problem:

--- old/nss/function.def 2002-02-21 16:57:50 -05:00
+++ new/nss/function.def 2005-11-22 15:40:48 -05:00
@@ -37,6 +37,7 @@
 DEFINE_ENT (files, host)
 DEFINE_GETBY (files, host, addr)
 DEFINE_GETBY (files, host, name)
+DEFINE_GETBY (files, host, name2)
 DEFINE_GET (files, hostton)
 DEFINE_GET (files, ntohost)
 DEFINE_GETBY (dns, host, addr)

-- 
           Summary: gethostbyname2()/getaddrinfo() skips /etc/hosts with --
                    enable-static-nss
           Product: glibc
           Version: 2.2.5
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: djohnson+sourceware at sw dot starentnetworks dot com
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: mips-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=1912

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]