Bug 11001 - getaddrinfo if a nss plugin returns NSS_STATUS_UNAVAIL with herrno = TRY_AGAIN or NO_DATA
Summary: getaddrinfo if a nss plugin returns NSS_STATUS_UNAVAIL with herrno = TRY_AGAI...
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-23 05:55 UTC by Aurelien Jarno
Modified: 2014-06-30 20:38 UTC (History)
1 user (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aurelien Jarno 2009-11-23 05:55:47 UTC
When a nss plugin returns NSS_STATUS_UNAVAIL with herrno = TRY_AGAIN or NO_DATA,
the no_data variable in gaih_inet() is set to a non-zero value. This variable is
used to signal to the rest of the gaih_inet procedure that no results are
available, which ignores the results of the other plugins.

This value should be reset upon success, like in the patch below:
--- a/sysdeps/posix/getaddrinfo.c       2010-11-22 16:21:19.000000000 -0500
+++ b/sysdeps/posix/getaddrinfo.c       2009-11-22 16:28:26.000000000 -0500
@@ -715,7 +715,10 @@ gaih_inet (const char *name, const struc
                                                   tmpbuflen, &rc, &herrno,
                                                   NULL));
                      if (status == NSS_STATUS_SUCCESS)
-                       break;
+                       {
+                         no_data = 0;
+                         break;
+                       }
                      if (status != NSS_STATUS_TRYAGAIN
                          || rc != ERANGE || herrno != NETDB_INTERNAL)
                        {
Comment 1 Andreas Schwab 2010-04-09 12:51:26 UTC
Should be fixed with c3dfadb87e16f0fab6f4d5242bcecf06c02976c7.