From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27491 invoked by alias); 22 Nov 2005 23:00:14 -0000 Received: (qmail 27365 invoked by uid 48); 22 Nov 2005 23:00:08 -0000 Date: Tue, 22 Nov 2005 23:00:00 -0000 From: "djohnson+sourceware at sw dot starentnetworks dot com" To: glibc-bugs@sources.redhat.com Message-ID: <20051122230007.1912.djohnson+sourceware@sw.starentnetworks.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug libc/1912] New: gethostbyname2()/getaddrinfo() skips /etc/hosts with --enable-static-nss X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2005-11/txt/msg00110.txt.bz2 List-Id: 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.