View Bug Activity | Format For Printing
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)
Although it should not matter since static NSS is only meant for initial porting I added the change.