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

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

[PATCH] Fix getnameinfo for many PTR record queries


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


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