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

--HG--
branch : 1.7

pwutil.c

index 26696fe70088f5268c629367c11dd1030047d50b..226ac9b6688c3ada09089b2e2e64c6467643863f 100644 (file)
--- a/pwutil.c
+++ b/pwutil.c
@@ -712,7 +712,7 @@ user_in_group(pw, 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]) {