[PATCH] Fix setting error return code of _nss_wins_gethostbyname_r

Jeremy Allison jra at samba.org
Tue Nov 15 23:19:49 UTC 2016


On Tue, Nov 15, 2016 at 07:50:12AM +0100, Andreas Schneider wrote:
> Hello,
> 
> 
> attached find a fix for _nss_wins_gethostbyname_r() if ip is set to NULL.
> 
> Tested by the reporter, see:
> 
> https://bugzilla.samba.org/show_bug.cgi?id=12269
> 
> 
> Please review and push!

LGTM - pushed !


> 
> 
> 
> 	Andreas
> 
> 
> -- 
> Andreas Schneider                   GPG-ID: CC014E3D
> Samba Team                             asn at samba.org
> www.samba.org

> From 310c1c689ea91d550dd5b4d74d41c2151c181464 Mon Sep 17 00:00:00 2001
> From: Andreas Schneider <asn at samba.org>
> Date: Sun, 13 Nov 2016 17:40:21 +0100
> Subject: [PATCH] nss_wins: Fix errno values for HOST_NOT_FOUND
> 
> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12269
> 
> Signed-off-by: Andreas Schneider <asn at samba.org>
> ---
>  nsswitch/wins.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/nsswitch/wins.c b/nsswitch/wins.c
> index dccb6dd..19d3c5b 100644
> --- a/nsswitch/wins.c
> +++ b/nsswitch/wins.c
> @@ -260,8 +260,7 @@ _nss_wins_gethostbyname_r(const char *hostname,
>  
>  	ip = lookup_byname_backend(name);
>  	if (ip == NULL) {
> -		*errnop = EINVAL;
> -		*h_errnop = NETDB_INTERNAL;
> +		*h_errnop = HOST_NOT_FOUND;
>  		nss_status = NSS_STATUS_NOTFOUND;
>  		goto out;
>  	}
> -- 
> 2.10.2
> 




More information about the samba-technical mailing list