]> granicus.if.org Git - sudo/commitdiff
If user has no supplementary groups, fall back on checking the group
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 10 Jan 2011 14:23:54 +0000 (09:23 -0500)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 10 Jan 2011 14:23:54 +0000 (09:23 -0500)
file expliticly.

plugins/sudoers/pwutil.c

index e8934ec3504167284fbfb79b198bf850614f8b40..256b8cdbe8abfe8e7cc0bfeb93072b3d6b622026 100644 (file)
@@ -687,7 +687,7 @@ user_in_group(struct passwd *pw, const char *group)
      * If we are matching the invoking or list user and that user has a
      * supplementary group vector, check it.
      */
-    if (user_ngroups >= 0 &&
+    if (user_ngroups > 0 &&
        strcmp(pw->pw_name, list_pw ? list_pw->pw_name : user_name) == 0) {
        for (i = 0; i < user_ngroups; i++) {
            if (grp->gr_gid == user_groups[i]) {