From 4ba1c12a7358b463c3d95eba02e510bae7ff2f56 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 10 Jan 2011 09:23:04 -0500 Subject: [PATCH] If user has no supplementary groups, fall back on checking the group file explicitly. --HG-- branch : 1.7 --- pwutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]) { -- 2.40.0