about summary refs log tree commit diff
path: root/nis/nss_nis/nis-pwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nss_nis/nis-pwd.c')
-rw-r--r--nis/nss_nis/nis-pwd.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/nis/nss_nis/nis-pwd.c b/nis/nss_nis/nis-pwd.c
index b70091508c..614637a173 100644
--- a/nis/nss_nis/nis-pwd.c
+++ b/nis/nss_nis/nis-pwd.c
@@ -106,7 +106,9 @@ internal_nis_getpwent_r (struct passwd *pwd, char *buffer, size_t buflen,
 
       if (retval != NSS_STATUS_SUCCESS)
         {
-          if (retval == NSS_STATUS_TRYAGAIN)
+	  if (retval == NSS_STATUS_NOTFOUND)
+	    *errnop = ENOENT;
+          else if (retval == NSS_STATUS_TRYAGAIN)
             *errnop = errno;
           return retval;
         }
@@ -231,7 +233,9 @@ _nss_nis_getpwnam_r (const char *name, struct passwd *pwd,
 
   if (retval != NSS_STATUS_SUCCESS)
     {
-      if (retval == NSS_STATUS_TRYAGAIN)
+      if (retval == NSS_STATUS_NOTFOUND)
+	*errnop = ENOENT;
+      else if (retval == NSS_STATUS_TRYAGAIN)
 	*errnop = errno;
       return retval;
     }
@@ -302,7 +306,10 @@ _nss_nis_getpwnam_r (const char *name, struct passwd *pwd,
       if (parse_res == -1)
         return NSS_STATUS_TRYAGAIN;
       else
-        return NSS_STATUS_NOTFOUND;
+	{
+	  *errnop = ENOENT;
+	  return NSS_STATUS_NOTFOUND;
+	}
     }
   else
     return NSS_STATUS_SUCCESS;
@@ -329,7 +336,9 @@ _nss_nis_getpwuid_r (uid_t uid, struct passwd *pwd,
 
   if (retval != NSS_STATUS_SUCCESS)
     {
-      if (retval == NSS_STATUS_TRYAGAIN)
+      if (retval == NSS_STATUS_NOTFOUND)
+	*errnop = ENOENT;
+      else if (retval == NSS_STATUS_TRYAGAIN)
 	*errnop = errno;
       return retval;
     }
@@ -400,8 +409,11 @@ _nss_nis_getpwuid_r (uid_t uid, struct passwd *pwd,
     {
       if (parse_res == -1)
         return NSS_STATUS_TRYAGAIN;
-      else
-        return NSS_STATUS_NOTFOUND;
+     else
+       {
+	 *errnop = ENOENT;
+	 return NSS_STATUS_NOTFOUND;
+       }
     }
   else
     return NSS_STATUS_SUCCESS;