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