From ffe2041a027cce4720f9b659a636ea99c245b0b0 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 26 Oct 2018 11:11:58 -0600 Subject: [PATCH] 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. --- lib/util/regress/getgrouplist/getgrouplist_test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); } -- 2.50.1