mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-05 19:35:52 +03:00
Fix a few error cases in *name4_r lookup handling.
This commit is contained in:
12
ChangeLog
12
ChangeLog
@@ -1,3 +1,15 @@
|
|||||||
|
2009-12-10 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
[BZ #11000]
|
||||||
|
* nis/nss_nis/nis-hosts.c (_nss_nis_gethostbyname4_r): Always set
|
||||||
|
*herrnop before returning.
|
||||||
|
* nis/nss_nisplus/nisplus-hosts.c (internal_gethostbyname2_r):
|
||||||
|
Likewise.
|
||||||
|
* nss/nss_files/files-hosts.c (_nss_files_gethostbyname4_r): Handle
|
||||||
|
TRYAGAIN errors separately.
|
||||||
|
* sysdeps/posix/getaddrinfo.c (gaih_inet): Fix error handling of
|
||||||
|
*name4_r after functions.
|
||||||
|
|
||||||
2009-12-09 Ulrich Drepper <drepper@redhat.com>
|
2009-12-09 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
[BZ #11046]
|
[BZ #11046]
|
||||||
|
@@ -456,7 +456,10 @@ _nss_nis_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
|
|||||||
{
|
{
|
||||||
char *domain;
|
char *domain;
|
||||||
if (yp_get_default_domain (&domain))
|
if (yp_get_default_domain (&domain))
|
||||||
|
{
|
||||||
|
*herrnop = NO_DATA;
|
||||||
return NSS_STATUS_UNAVAIL;
|
return NSS_STATUS_UNAVAIL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Convert name to lowercase. */
|
/* Convert name to lowercase. */
|
||||||
size_t namlen = strlen (name);
|
size_t namlen = strlen (name);
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1997-2003, 2005, 2006, 2008 Free Software Foundation, Inc.
|
/* Copyright (C) 1997-2003, 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Thorsten Kukuk <kukuk@suse.de>, 1997.
|
Contributed by Thorsten Kukuk <kukuk@suse.de>, 1997.
|
||||||
|
|
||||||
@@ -435,6 +435,7 @@ internal_gethostbyname2_r (const char *name, int af, struct hostent *host,
|
|||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
{
|
{
|
||||||
*errnop = ENOMEM;
|
*errnop = ENOMEM;
|
||||||
|
*herrnop = NETDB_INTERNAL;
|
||||||
return NSS_STATUS_TRYAGAIN;
|
return NSS_STATUS_TRYAGAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -444,10 +445,13 @@ internal_gethostbyname2_r (const char *name, int af, struct hostent *host,
|
|||||||
if (retval == NSS_STATUS_TRYAGAIN)
|
if (retval == NSS_STATUS_TRYAGAIN)
|
||||||
{
|
{
|
||||||
*errnop = errno;
|
*errnop = errno;
|
||||||
*herrnop = NETDB_INTERNAL;
|
*herrnop = TRY_AGAIN;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
__set_errno (olderr);
|
__set_errno (olderr);
|
||||||
|
*herrnop = NETDB_INTERNAL;
|
||||||
|
}
|
||||||
nis_freeresult (result);
|
nis_freeresult (result);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
@@ -423,6 +423,11 @@ _nss_files_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
|
|||||||
if (! keep_stream)
|
if (! keep_stream)
|
||||||
internal_endent ();
|
internal_endent ();
|
||||||
}
|
}
|
||||||
|
else if (status == NSS_STATUS_TRYAGAIN)
|
||||||
|
{
|
||||||
|
*errnop = errno;
|
||||||
|
*herrnop = TRY_AGAIN;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*errnop = errno;
|
*errnop = errno;
|
||||||
|
@@ -719,13 +719,8 @@ gaih_inet (const char *name, const struct gaih_service *service,
|
|||||||
if (status != NSS_STATUS_TRYAGAIN
|
if (status != NSS_STATUS_TRYAGAIN
|
||||||
|| rc != ERANGE || herrno != NETDB_INTERNAL)
|
|| rc != ERANGE || herrno != NETDB_INTERNAL)
|
||||||
{
|
{
|
||||||
if (herrno == NETDB_INTERNAL)
|
if (status == NSS_STATUS_TRYAGAIN
|
||||||
{
|
&& herrno == TRY_AGAIN)
|
||||||
__set_h_errno (herrno);
|
|
||||||
_res.options = old_res_options;
|
|
||||||
return -EAI_SYSTEM;
|
|
||||||
}
|
|
||||||
if (herrno == TRY_AGAIN)
|
|
||||||
no_data = EAI_AGAIN;
|
no_data = EAI_AGAIN;
|
||||||
else
|
else
|
||||||
no_data = herrno == NO_DATA;
|
no_data = herrno == NO_DATA;
|
||||||
|
Reference in New Issue
Block a user