|
|
147e83 |
commit 3d04f5db20c8f0d1ba3881b5f5373586a18cf188
|
|
|
147e83 |
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
|
|
|
147e83 |
Date: Tue May 21 21:54:41 2013 +0530
|
|
|
147e83 |
|
|
|
147e83 |
Set EAI_SYSTEM only when h_errno is NETDB_INTERNAL
|
|
|
147e83 |
|
|
|
147e83 |
Fixes BZ #15339.
|
|
|
147e83 |
|
|
|
147e83 |
NSS_STATUS_UNAVAIL may mean that a necessary input resource is not
|
|
|
147e83 |
available. This could occur in a number of cases including when the
|
|
|
147e83 |
network is down, system runs out of file descriptors, etc. The
|
|
|
147e83 |
correct differentiator in such a case is the h_errno, which gives the
|
|
|
147e83 |
nature of failure. In case of failures other than a simple 'not
|
|
|
147e83 |
found', we set h_errno as NETDB_INTERNAL and let errno be the
|
|
|
147e83 |
identifier for the exact error.
|
|
|
147e83 |
|
|
|
147e83 |
diff --git glibc-2.17-c758a686/nss/getXXbyYY_r.c glibc-2.17-c758a686/nss/getXXbyYY_r.c
|
|
|
147e83 |
index 44d00f4..33e63d4 100644
|
|
|
147e83 |
--- glibc-2.17-c758a686/nss/getXXbyYY_r.c
|
|
|
147e83 |
+++ glibc-2.17-c758a686/nss/getXXbyYY_r.c
|
|
|
147e83 |
@@ -287,10 +287,10 @@ done:
|
|
|
147e83 |
#endif
|
|
|
147e83 |
*result = status == NSS_STATUS_SUCCESS ? resbuf : NULL;
|
|
|
147e83 |
#ifdef NEED_H_ERRNO
|
|
|
147e83 |
- if (status == NSS_STATUS_UNAVAIL)
|
|
|
147e83 |
- /* Either we failed to lookup the functions or the functions themselves
|
|
|
147e83 |
- had a system error. Set NETDB_INTERNAL here to let the caller know
|
|
|
147e83 |
- that the errno may have the real reason for failure. */
|
|
|
147e83 |
+ if (status == NSS_STATUS_UNAVAIL && !any_service && errno != ENOENT)
|
|
|
147e83 |
+ /* This happens when we weren't able to use a service for reasons other
|
|
|
147e83 |
+ than the module not being found. In such a case, we'd want to tell the
|
|
|
147e83 |
+ caller that errno has the real reason for failure. */
|
|
|
147e83 |
*h_errnop = NETDB_INTERNAL;
|
|
|
147e83 |
else if (status != NSS_STATUS_SUCCESS && !any_service)
|
|
|
147e83 |
/* We were not able to use any service. */
|
|
|
147e83 |
diff --git glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c
|
|
|
147e83 |
index ab135ad..7bb3ded 100644
|
|
|
147e83 |
--- glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c
|
|
|
147e83 |
+++ glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c
|
|
|
147e83 |
@@ -1036,7 +1036,15 @@ gaih_inet (const char *name, const struct gaih_service *service,
|
|
|
147e83 |
}
|
|
|
147e83 |
}
|
|
|
147e83 |
else
|
|
|
147e83 |
- status = NSS_STATUS_UNAVAIL;
|
|
|
147e83 |
+ {
|
|
|
147e83 |
+ status = NSS_STATUS_UNAVAIL;
|
|
|
147e83 |
+ /* Could not load any of the lookup functions. Indicate
|
|
|
147e83 |
+ an internal error if the failure was due to a system
|
|
|
147e83 |
+ error other than the file not being found. We use the
|
|
|
147e83 |
+ errno from the last failed callback. */
|
|
|
147e83 |
+ if (errno != 0 && errno != ENOENT)
|
|
|
147e83 |
+ __set_h_errno (NETDB_INTERNAL);
|
|
|
147e83 |
+ }
|
|
|
147e83 |
}
|
|
|
147e83 |
|
|
|
147e83 |
if (nss_next_action (nip, status) == NSS_ACTION_RETURN)
|
|
|
147e83 |
@@ -1050,7 +1058,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
|
|
|
147e83 |
|
|
|
147e83 |
_res.options |= old_res_options & RES_USE_INET6;
|
|
|
147e83 |
|
|
|
147e83 |
- if (status == NSS_STATUS_UNAVAIL)
|
|
|
147e83 |
+ if (h_errno == NETDB_INTERNAL)
|
|
|
147e83 |
{
|
|
|
147e83 |
result = GAIH_OKIFUNSPEC | -EAI_SYSTEM;
|
|
|
147e83 |
goto free_and_return;
|
|
|
147e83 |
_______________________________________________
|
|
|
147e83 |
glibc mailing list
|
|
|
147e83 |
glibc@lists.fedoraproject.org
|
|
|
147e83 |
https://admin.fedoraproject.org/mailman/listinfo/glibc
|