From 8a043ca562cd15bd6c4a3d243ce0fa20d4d040b3 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 10 Jan 2011 09:23:54 -0500 Subject: [PATCH] If user has no supplementary groups, fall back on checking the group file expliticly. --- plugins/sudoers/pwutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sudoers/pwutil.c b/plugins/sudoers/pwutil.c index e8934ec35..256b8cdbe 100644 --- a/plugins/sudoers/pwutil.c +++ b/plugins/sudoers/pwutil.c @@ -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]) { -- 2.40.0