nwrap: fix return code for getaddrinfo in case service is not valid
authorMichael Adam <obnox@samba.org>
Fri, 6 Nov 2015 10:00:54 +0000 (11:00 +0100)
committerMichael Adam <obnox@samba.org>
Fri, 6 Nov 2015 10:00:54 +0000 (11:00 +0100)
If the specified service is not a valid service name (or port number),
EAI_NONAME should be returned.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
src/nss_wrapper.c

index 9404d173d726d7d1da47c30402efba6f5ed551dc..986b974429acf58045a205f5ec7d7142dcbc5a15 100644 (file)
@@ -5108,7 +5108,7 @@ static int nwrap_getaddrinfo(const char *node,
                        if (p != NULL) {
                                freeaddrinfo(p);
                        }
-                       return EAI_SERVICE;
+                       return EAI_NONAME;
                }
        }