]> granicus.if.org Git - shadow/commitdiff
* NEWS, libmisc/addgrps.c: Fix allocator loop. Continue to
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Thu, 2 Jun 2011 15:36:29 +0000 (15:36 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Thu, 2 Jun 2011 15:36:29 +0000 (15:36 +0000)
getgroups() when getgroups fails (-1) with errno==EINVAL.

ChangeLog
NEWS
libmisc/addgrps.c

index 1136c4ac0ed7d6b2770ac54759f7aff6828c03ae..b8dbad05b26eb210669808c1fbca3ca98ffff3d1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-06-02  Cal Peake  <cp@absolutedigital.net>
+
+       * NEWS, libmisc/addgrps.c: Fix allocator loop. Continue to
+       getgroups() when getgroups fails (-1) with errno==EINVAL.
+
 2011-06-01  Simon Brandmair  <sbrandmair@gmx.net>
 
        * man/newusers.8.xml, man/suauth.5.xml, man/suauth.5.xml,
diff --git a/NEWS b/NEWS
index 8be05e901cb349ab895bda00aa844256f03807f9..d6698c76e3f38d1d0921799ceb8fab071f8928a5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,8 @@ shadow-4.1.4.3 -> shadow-4.1.5                                        UNRELEASED
     enabled versions only)
   * Fixed infinite loop when CONSOLE is configured with a colon-separated
     list of TTYs.
+  * Fixed warning and support for CONSOLE_GROUPS for users member of more
+    than 16 groups.
 - su
   * Document the su exit values.
   * When su receives a signal, wait for the child to terminate (after
@@ -35,6 +37,8 @@ shadow-4.1.4.3 -> shadow-4.1.5                                        UNRELEASED
   * Default ENV_SUPATH is /sbin:/bin:/usr/sbin:/usr/bin
   * Fixed infinite loop when CONSOLE is configured with a colon-separated
     list of TTYs.
+  * Fixed warning and support for CONSOLE_GROUPS for users member of more
+    than 16 groups.
 - newgrp, sg, groupmems
   * Fix parsing of gshadow entries.
 - useradd
index 1d0356fa64ffc7b5c3b7cd68aeb7afbcf1444efd..40fad994d89e6d6113029bc49ccd9bbd9264d588 100644 (file)
@@ -71,7 +71,11 @@ int add_groups (const char *list)
                        return -1;
                }
                ngroups = getgroups (i, grouplist);
-               if ((-1 == ngroups) || (i > (size_t)ngroups)) {
+               if (   (   (-1 == ngroups)
+                       && (EINVAL != errno))
+                   || (i > (size_t)ngroups)) {
+                       /* Unexpected failure of getgroups or successful
+                        * reception of the groups */
                        break;
                }
                /* not enough room, so try allocating a larger buffer */