From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6567 invoked by alias); 25 Feb 2008 16:51:06 -0000 Received: (qmail 6550 invoked by uid 22791); 25 Feb 2008 16:51:06 -0000 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 25 Feb 2008 16:50:43 +0000 Received: from sunsite.mff.cuni.cz (localhost.localdomain [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.8/8.13.8) with ESMTP id m1PGtVF3005833; Mon, 25 Feb 2008 17:55:31 +0100 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.13.8/8.13.8/Submit) id m1PGtV5n005832; Mon, 25 Feb 2008 17:55:31 +0100 Date: Mon, 25 Feb 2008 16:51:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers Subject: [PATCH] Fix getnameinfo for many PTR record queries Message-ID: <20080225165531.GE3726@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2008-02/txt/msg00004.txt.bz2 Hi! _nss_dns_gethostbyname* trusts getanswer_r to set *errnop and *h_errnop right (and from what I can see, at least for the too small buffer case it does the right thing), but _nss_dns_gethostbyaddr2_r will overwrite anything getanswer_r put into those variables with whatever h_errno/errno contain (which probably isn't related to the current error). I've tested it fixes the 258 PTR records getnameinfo query in BZ, though haven't done much testing beyond that. 2008-02-25 Jakub Jelinek [BZ #5790] * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyaddr2_r): Don't overwrite *h_errnop/*errnop values from getanswer_r in case of failure. --- libc/resolv/nss_dns/dns-host.c 30 Oct 2007 00:57:56 -0000 1.46 +++ libc/resolv/nss_dns/dns-host.c 25 Feb 2008 16:04:58 -0000 @@ -386,11 +386,7 @@ _nss_dns_gethostbyaddr2_r (const void *a if (host_buffer.buf != orig_host_buffer) free (host_buffer.buf); if (status != NSS_STATUS_SUCCESS) - { - *h_errnop = h_errno; - *errnop = errno; - return status; - } + return status; #ifdef SUNSECURITY This is not implemented because it is not possible to use the current Jakub