From: Todd C. Miller Date: Mon, 10 Jan 2011 14:23:04 +0000 (-0500) Subject: If user has no supplementary groups, fall back on checking the group file X-Git-Tag: SUDO_1_7_5~79 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ba1c12a7358b463c3d95eba02e510bae7ff2f56;p=sudo If user has no supplementary groups, fall back on checking the group file explicitly. --HG-- branch : 1.7 --- diff --git a/pwutil.c b/pwutil.c index 26696fe70..226ac9b66 100644 --- 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]) {