about summary refs log tree commit diff
path: root/nis/nss_nis/nis-service.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nss_nis/nis-service.c')
-rw-r--r--nis/nss_nis/nis-service.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/nis/nss_nis/nis-service.c b/nis/nss_nis/nis-service.c
index 6e086e42a3..32ac619de0 100644
--- a/nis/nss_nis/nis-service.c
+++ b/nis/nss_nis/nis-service.c
@@ -330,6 +330,10 @@ _nss_nis_getservbyname_r (const char *name, const char *protocol,
 	return NSS_STATUS_SUCCESS;
     }
 
+  /* Check if it is safe to rely on services.byservicename.  */
+  if (_nis_default_nss () & NSS_FLAG_SERVICES_AUTHORITATIVE)
+    return status;
+
   struct ypall_callback ypcb;
   struct search_t req;