summaryrefslogtreecommitdiff
path: root/nis
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-03-18 04:24:53 +0000
committerUlrich Drepper <drepper@redhat.com>1997-03-18 04:24:53 +0000
commitea00844dfbaa9740f7805215a253414761b50710 (patch)
tree4e1df88376825e054c065c15a9e7748e3315ab83 /nis
parent59c37b6b21d585e006fbf896f1a87c54eadbabbf (diff)
(_nss_nis_getservbyname_r): Allow protocol=NULL to match any protocol
rather than returning an error.
Diffstat (limited to 'nis')
-rw-r--r--nis/nss_nis/nis-service.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/nis/nss_nis/nis-service.c b/nis/nss_nis/nis-service.c
index fe189b161b..ae7667f231 100644
--- a/nis/nss_nis/nis-service.c
+++ b/nis/nss_nis/nis-service.c
@@ -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;