From: Todd C. Miller Date: Fri, 26 Oct 2018 17:11:58 +0000 (-0600) Subject: Skip sudo_getgrouplist2() check on systems with getgrouplist_2(). X-Git-Tag: SUDO_1_8_26^2~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ffe2041a027cce4720f9b659a636ea99c245b0b0;p=sudo Skip sudo_getgrouplist2() check on systems with getgrouplist_2(). sudo_getgrouplist2() is just a wrapper on such systems and this avoids a test failure on macOS where a user is automatically a member of certain groups. --- diff --git a/lib/util/regress/getgrouplist/getgrouplist_test.c b/lib/util/regress/getgrouplist/getgrouplist_test.c index a88d80b13..4d44cf2f6 100644 --- a/lib/util/regress/getgrouplist/getgrouplist_test.c +++ b/lib/util/regress/getgrouplist/getgrouplist_test.c @@ -46,11 +46,13 @@ __dso_public int main(int argc, char *argv[]); int main(int argc, char *argv[]) { + int errors = 0; +#ifndef HAVE_GETGROUPLIST_2 GETGROUPS_T *groups = NULL; struct passwd *pw; struct group *grp; char *username; - int i, j, errors = 0, ntests = 0; + int i, j, ntests = 0; int ngroups; gid_t basegid; initprogname(argc > 0 ? argv[0] : "getgrouplist_test"); @@ -97,5 +99,6 @@ main(int argc, char *argv[]) printf("%s: %d tests run, %d errors, %d%% success rate\n", getprogname(), ntests, errors, (ntests - errors) * 100 / ntests); } +#endif /* HAVE_GETGROUPLIST_2 */ exit(errors); }