]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(_nss_nis_getservbyname_r): Allow protocol=NULL to match any protocol
authorUlrich Drepper <drepper@redhat.com>
Tue, 18 Mar 1997 04:24:53 +0000 (04:24 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 18 Mar 1997 04:24:53 +0000 (04:24 +0000)
rather than returning an error.

nis/nss_nis/nis-service.c

index fe189b161be689d4a50e154b2dae1a49d8a1fab3..ae7667f2315e34b332cd38e1d7e21b46ce9e8086 100644 (file)
@@ -204,7 +204,7 @@ _nss_nis_getservbyname_r (const char *name, char *protocol,
   enum nss_status status;
   int found;
 
-  if (name == NULL || protocol == NULL)
+  if (name == NULL)
     {
       __set_errno (EINVAL);
       return NSS_STATUS_UNAVAIL;
@@ -219,7 +219,7 @@ _nss_nis_getservbyname_r (const char *name, char *protocol,
          ((status = internal_nis_getservent_r (serv, buffer, buflen, &data))
           == NSS_STATUS_SUCCESS))
     {
-      if (strcmp (serv->s_proto, protocol) == 0)
+      if (protocol == NULL || strcmp (serv->s_proto, protocol) == 0)
        {
          char **cp;