public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Ulrich Drepper <drepper@redhat.com>
Cc: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: [PATCH] Fix getnameinfo for many PTR record queries
Date: Mon, 25 Feb 2008 16:51:00 -0000	[thread overview]
Message-ID: <20080225165531.GE3726@sunsite.mff.cuni.cz> (raw)

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  <jakub@redhat.com>

	[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

                 reply	other threads:[~2008-02-25 16:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080225165531.GE3726@sunsite.mff.cuni.cz \
    --to=jakub@redhat.com \
    --cc=drepper@redhat.com \
    --cc=libc-hacker@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).