summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorWill <willhy@gmail.com>2017-11-07 21:52:34 -0600
committerAndrew Bartlett <abartlet@samba.org>2018-12-17 01:24:15 +0100
commitf460bb52ed4393722d58f9e6d30bd0c7e6a51f1d (patch)
treef5a94d064115b13683405cb0a83d6703269b4157 /source4/torture
parent440ddf8470b11a46066d282bf8945201d547c192 (diff)
downloadsamba-f460bb52ed4393722d58f9e6d30bd0c7e6a51f1d.tar.gz
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 <willhy@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/local/nss_tests.c4
1 files changed, 4 insertions, 0 deletions
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();