From: Todd C. Miller Date: Mon, 23 Jul 2018 13:23:17 +0000 (-0600) Subject: Linux getgrouplist(3) returns the number of groups on success instead X-Git-Tag: SUDO_1_8_24^2~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e7daff062f9c5e6ab665859f28e299814696632b;p=sudo Linux getgrouplist(3) returns the number of groups on success instead of 0 like BSD. --- 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;