fa3bfd
commit d41242129ba693cdbc8db85b846fcaccf9f0b7c4
fa3bfd
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
fa3bfd
Date:   Thu Jan 2 10:03:12 2014 +0530
fa3bfd
fa3bfd
    Fix infinite loop in nscd when netgroup is empty (bz #16365)
fa3bfd
12745e
diff -pruN glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/netgroupcache.c
12745e
--- glibc-2.17-c758a686/nscd/netgroupcache.c	2013-12-20 04:38:40.432000000 -0500
12745e
+++ glibc-2.17-c758a686/nscd/netgroupcache.c	2013-12-20 04:37:29.945000000 -0500
2e9afc
@@ -204,9 +204,10 @@ addgetnetgrentX (struct database_dyn *db
2e9afc
 		    int e;
2e9afc
 		    status = getfct.f (&data, buffer + buffilled,
2e9afc
 				       buflen - buffilled, &e);
2e9afc
-		    if (status == NSS_STATUS_RETURN)
2e9afc
-		      /* This was the last one for this group.  Look
2e9afc
-			 at next group if available.  */
2e9afc
+		    if (status == NSS_STATUS_RETURN
2e9afc
+			|| status == NSS_STATUS_NOTFOUND)
2e9afc
+		      /* This was either the last one for this group or the
2e9afc
+			 group was empty.  Look at next group if available.  */
2e9afc
 		      break;
2e9afc
 		    if (status == NSS_STATUS_SUCCESS)
2e9afc
 		      {