From f460bb52ed4393722d58f9e6d30bd0c7e6a51f1d Mon Sep 17 00:00:00 2001 From: Will Date: Tue, 7 Nov 2017 21:52:34 -0600 Subject: [PATCH] Conditionally disable macOS incompatible tests Symbols _getgrent_r and _getpwent_r in source4/torture/local/nss_tests.c are undefined in macOS. It seems that checking HAVE_GETGRENT_R and HAVE_GETPWENT_R and conditionally disabling those tests as suggested by hirochachacha in the referenced bug allows samba on both `master` and `samba-4.7.1` to build properly on macOS/darwin. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11984 Signed-off-by: Will Haley Reviewed-by: Andreas Schneider Reviewed-by: Ralph Boehme Reviewed-by: Andrew Bartlett --- source4/torture/local/nss_tests.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source4/torture/local/nss_tests.c b/source4/torture/local/nss_tests.c index cc02047d565..29431220d5e 100644 --- a/source4/torture/local/nss_tests.c +++ b/source4/torture/local/nss_tests.c @@ -346,6 +346,7 @@ static bool test_enum_r_passwd(struct torture_context *tctx, torture_comment(tctx, "Testing setpwent\n"); setpwent(); +#ifdef HAVE_GETPWENT_R /* getpwent_r not supported on macOS */ while (1) { torture_comment(tctx, "Testing getpwent_r\n"); @@ -368,6 +369,7 @@ static bool test_enum_r_passwd(struct torture_context *tctx, num_pwd++; } } +#endif /* getpwent_r not supported on macOS */ torture_comment(tctx, "Testing endpwent\n"); endpwent(); @@ -544,6 +546,7 @@ static bool test_enum_r_group(struct torture_context *tctx, torture_comment(tctx, "Testing setgrent\n"); setgrent(); +#ifdef HAVE_GETGRENT_R /* getgrent_r not supported on macOS */ while (1) { torture_comment(tctx, "Testing getgrent_r\n"); @@ -566,6 +569,7 @@ static bool test_enum_r_group(struct torture_context *tctx, num_grp++; } } +#endif /* getgrent_r not supported on macOS */ torture_comment(tctx, "Testing endgrent\n"); endgrent(); -- 2.34.1