From e7daff062f9c5e6ab665859f28e299814696632b Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 23 Jul 2018 07:23:17 -0600 Subject: [PATCH] Linux getgrouplist(3) returns the number of groups on success instead of 0 like BSD. --- lib/util/getgrouplist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util/getgrouplist.c b/lib/util/getgrouplist.c index ed4d58231..ce4e6d063 100644 --- a/lib/util/getgrouplist.c +++ b/lib/util/getgrouplist.c @@ -97,7 +97,7 @@ sudo_getgrouplist2_v1(const char *name, GETGROUPS_T basegid, return -1; grpsize <<= 1; ngroups = grpsize; - if (getgrouplist(name, basegid, groups, &ngroups) == 0) { + if (getgrouplist(name, basegid, groups, &ngroups) != -1) { *groupsp = groups; *ngroupsp = ngroups; return 0; -- 2.40.0