about summary refs log tree commit diff
path: root/nis
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-09-19 01:33:17 +0000
committerUlrich Drepper <drepper@redhat.com>1999-09-19 01:33:17 +0000
commite7dc6624b813cf2a918d8a003362577efe66a9a8 (patch)
treeedcaff0aba7f6a27b1a319cde60dbadc5a93c977 /nis
parent454298f40cbcc6ffe0cecfbe434f18bb764734ad (diff)
downloadglibc-e7dc6624b813cf2a918d8a003362577efe66a9a8.tar.gz
glibc-e7dc6624b813cf2a918d8a003362577efe66a9a8.tar.xz
glibc-e7dc6624b813cf2a918d8a003362577efe66a9a8.zip
(getgrgid_plusgroup): Correct returned errno value in some cases.
Diffstat (limited to 'nis')
-rw-r--r--nis/nss_compat/compat-grp.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/nis/nss_compat/compat-grp.c b/nis/nss_compat/compat-grp.c
index 3ef2039e84..ac56f6fbec 100644
--- a/nis/nss_compat/compat-grp.c
+++ b/nis/nss_compat/compat-grp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
 
@@ -438,7 +438,10 @@ getgrnam_plusgroup (const char *name, struct group *result, char *buffer,
       int outvallen;
 
       if (yp_get_default_domain (&domain) != YPERR_SUCCESS)
-	return NSS_STATUS_NOTFOUND;
+	{
+	  *errnop = ENOENT;
+	  return NSS_STATUS_NOTFOUND;
+	}
 
       if (yp_match (domain, "group.byname", name, strlen (name),
 		    &outval, &outvallen) != YPERR_SUCCESS)
@@ -784,8 +787,8 @@ getgrgid_plusgroup (gid_t gid, struct group *result, char *buffer,
 
       if (yp_get_default_domain (&domain) != YPERR_SUCCESS)
 	{
-	  *errnop = errno;
-	  return NSS_STATUS_TRYAGAIN;
+	  *errnop = ENOENT;
+	  return NSS_STATUS_NOTFOUND;
 	}
 
       snprintf (buf, sizeof (buf), "%d", gid);
@@ -793,8 +796,8 @@ getgrgid_plusgroup (gid_t gid, struct group *result, char *buffer,
       if (yp_match (domain, "group.bygid", buf, strlen (buf),
 		    &outval, &outvallen) != YPERR_SUCCESS)
 	{
-	  *errnop = errno;
-	  return NSS_STATUS_TRYAGAIN;
+	  *errnop = ENOENT;
+	  return NSS_STATUS_NOTFOUND;
 	}
 
       if (buflen < ((size_t) outvallen + 1))