From 382345126c56e26d3dbc319f1c7c1dae3c4fafc9 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 20 Sep 2016 13:26:52 +0200 Subject: nsswitch: Also set h_errnop for nss_wins functions BUG: https://bugzilla.samba.org/show_bug.cgi?id=12269 Signed-off-by: Andreas Schneider Reviewed-by: Jim McDonough Autobuild-User(master): Jim McDonough Autobuild-Date(master): Tue Sep 20 20:16:43 CEST 2016 on sn-devel-144 --- nsswitch/wins.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'nsswitch') diff --git a/nsswitch/wins.c b/nsswitch/wins.c index be84f2e0a1b..dccb6dd90ed 100644 --- a/nsswitch/wins.c +++ b/nsswitch/wins.c @@ -261,6 +261,7 @@ _nss_wins_gethostbyname_r(const char *hostname, ip = lookup_byname_backend(name); if (ip == NULL) { *errnop = EINVAL; + *h_errnop = NETDB_INTERNAL; nss_status = NSS_STATUS_NOTFOUND; goto out; } @@ -269,6 +270,7 @@ _nss_wins_gethostbyname_r(const char *hostname, wbcFreeMemory(ip); if (rc == 0) { *errnop = errno; + *h_errnop = NETDB_INTERNAL; nss_status = NSS_STATUS_TRYAGAIN; goto out; } @@ -279,6 +281,7 @@ _nss_wins_gethostbyname_r(const char *hostname, if ((he->h_name = get_static(&buffer, &buflen, namelen)) == NULL) { *errnop = EAGAIN; + *h_errnop = NETDB_INTERNAL; nss_status = NSS_STATUS_TRYAGAIN; goto out; } @@ -292,6 +295,7 @@ _nss_wins_gethostbyname_r(const char *hostname, if (get_static(&buffer, &buflen, i) == NULL) { *errnop = EAGAIN; + *h_errnop = NETDB_INTERNAL; nss_status = NSS_STATUS_TRYAGAIN; goto out; } @@ -299,6 +303,7 @@ _nss_wins_gethostbyname_r(const char *hostname, if ((he->h_addr_list = (char **)get_static( &buffer, &buflen, 2 * sizeof(char *))) == NULL) { *errnop = EAGAIN; + *h_errnop = NETDB_INTERNAL; nss_status = NSS_STATUS_TRYAGAIN; goto out; } @@ -306,6 +311,7 @@ _nss_wins_gethostbyname_r(const char *hostname, if ((he->h_addr_list[0] = get_static(&buffer, &buflen, INADDRSZ)) == NULL) { *errnop = EAGAIN; + *h_errnop = NETDB_INTERNAL; nss_status = NSS_STATUS_TRYAGAIN; goto out; } @@ -326,6 +332,7 @@ _nss_wins_gethostbyname_r(const char *hostname, if (get_static(&buffer, &buflen, i) == NULL) { *errnop = EAGAIN; + *h_errnop = NETDB_INTERNAL; nss_status = NSS_STATUS_TRYAGAIN; goto out; } @@ -333,12 +340,14 @@ _nss_wins_gethostbyname_r(const char *hostname, if ((he->h_aliases = (char **)get_static( &buffer, &buflen, sizeof(char *))) == NULL) { *errnop = EAGAIN; + *h_errnop = NETDB_INTERNAL; nss_status = NSS_STATUS_TRYAGAIN; goto out; } he->h_aliases[0] = NULL; + *h_errnop = NETDB_SUCCESS; nss_status = NSS_STATUS_SUCCESS; out: -- cgit v1.2.1