bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: inifite loop in recent mgetgroups.c:mgetgroups on Darwin/MacOS


From: Steven Parkes
Subject: RE: inifite loop in recent mgetgroups.c:mgetgroups on Darwin/MacOS
Date: Tue, 7 Apr 2009 12:59:09 -0700

Sorry; that patch was bogus. This one is not, though I still don't like that
it returns the wrong result:

diff --git a/gl/lib/mgetgroups.c b/gl/lib/mgetgroups.c
index e697013..b3a2a1a 100644
--- a/gl/lib/mgetgroups.c
+++ b/gl/lib/mgetgroups.c
@@ -94,6 +94,11 @@ mgetgroups (char const *username, gid_t gid, GETGROUPS_T
**groups)
            }
          g = h;
 
+          if (ng < 0 && max_n_groups <= N_GROUPS_INIT)
+            {
+                ng = max_n_groups;
+            }
+
          if (0 <= ng)
            {
              *groups = g;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]