]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - nis/nss_compat/compat-grp.c
Update.
[thirdparty/glibc.git] / nis / nss_compat / compat-grp.c
index a586d1fbbf2e38057d2baf99eb15bd3d7c89f473..4b873d69153820b002c6ace396cafb41fb3e69da 100644 (file)
@@ -125,9 +125,14 @@ internal_setgrent (ent_t *ent)
       ent->result = NULL;
     }
 
-  ent->blacklist.current = 0;
   if (ent->blacklist.data != NULL)
-    ent->blacklist.data[0] = '\0';
+    {
+      ent->blacklist.current = 1;
+      ent->blacklist.data[0] = '|';
+      ent->blacklist.data[1] = '\0';
+    }
+  else
+    ent->blacklist.current = 0;
 
   if (ent->stream == NULL)
     {
@@ -202,9 +207,14 @@ internal_endgrent (ent_t *ent)
       ent->result = NULL;
     }
 
-  ent->blacklist.current = 0;
   if (ent->blacklist.data != NULL)
-    ent->blacklist.data[0] = '\0';
+    {
+      ent->blacklist.current = 1;
+      ent->blacklist.data[0] = '|';
+      ent->blacklist.data[1] = '\0';
+    }
+  else
+    ent->blacklist.current = 0;
 
   return NSS_STATUS_SUCCESS;
 }
@@ -411,22 +421,17 @@ getgrnam_plusgroup (const char *name, struct group *result, char *buffer,
       int outvallen;
 
       if (yp_get_default_domain (&domain) != YPERR_SUCCESS)
-       {
-         *errnop = errno;
-         return NSS_STATUS_TRYAGAIN;
-       }
+       return NSS_STATUS_NOTFOUND;
 
       if (yp_match (domain, "group.byname", name, strlen (name),
                    &outval, &outvallen) != YPERR_SUCCESS)
-       {
-         *errnop = errno;
-         return NSS_STATUS_TRYAGAIN;
-       }
+       return NSS_STATUS_NOTFOUND;
+
       p = strncpy (buffer, outval,
                    buflen < (size_t) outvallen ? buflen : (size_t) outvallen);
       free (outval);
       while (isspace (*p))
-        p++;
+        ++p;
       parse_res = _nss_files_parse_grent (p, result, data, buflen, errnop);
       if (parse_res == -1)
        return NSS_STATUS_TRYAGAIN;
@@ -513,7 +518,8 @@ getgrent_next_file (struct group *result, ent_t *ent,
           if (status == NSS_STATUS_SUCCESS) /* We found the entry. */
             break;
           else
-            if (status == NSS_STATUS_RETURN) /* We couldn't parse the entry */
+            if (status == NSS_STATUS_RETURN /* We couldn't parse the entry */
+               || status == NSS_STATUS_NOTFOUND) /* No group in NIS */
               continue;
             else
              {