aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-connectivity/samba/samba/samba-4.3.9-remove-getpwent_r.patch
blob: 0c967be62fdaa2a5276259753bdbd594ec8c3b66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
From e5d9527e6b3b386229747f799c725fcd68bc5228 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 6 Nov 2016 23:40:54 -0800
Subject: [PATCH] Musl does not have _r versions of getent() and getpwent()
 APIs

Taken from gentoo
http://data.gpo.zugaina.org/musl/net-fs/samba/files/samba-4.3.9-remove-getpwent_r.patch

Upstream-Status: Pending

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 source4/torture/local/nss_tests.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/source4/torture/local/nss_tests.c b/source4/torture/local/nss_tests.c
index e911aa2..2b39b74 100644
--- a/source4/torture/local/nss_tests.c
+++ b/source4/torture/local/nss_tests.c
@@ -247,7 +247,6 @@ static bool test_getgrnam_r(struct torture_context *tctx,
 	return true;
 }
 
-
 static bool test_getgrgid(struct torture_context *tctx,
 			  gid_t gid,
 			  struct group *grp_p)
@@ -333,6 +332,7 @@ static bool test_enum_passwd(struct torture_context *tctx,
 	return true;
 }
 
+#if HAVE_GETPWENT_R
 static bool test_enum_r_passwd(struct torture_context *tctx,
 			       struct passwd **pwd_array_p,
 			       size_t *num_pwd_p)
@@ -383,6 +383,7 @@ static bool test_enum_r_passwd(struct torture_context *tctx,
 
 	return true;
 }
+#endif
 
 static bool torture_assert_passwd_equal(struct torture_context *tctx,
 					const struct passwd *p1,
@@ -434,7 +435,7 @@ static bool test_passwd_r(struct torture_context *tctx)
 	struct passwd *pwd, pwd1, pwd2;
 	size_t num_pwd;
 
-	torture_assert(tctx, test_enum_r_passwd(tctx, &pwd, &num_pwd),
+	torture_assert(tctx, test_enum_passwd(tctx, &pwd, &num_pwd),
 						"failed to enumerate passwd");
 
 	for (i=0; i < num_pwd; i++) {
@@ -462,7 +463,7 @@ static bool test_passwd_r_cross(struct torture_context *tctx)
 	struct passwd *pwd, pwd1, pwd2, pwd3, pwd4;
 	size_t num_pwd;
 
-	torture_assert(tctx, test_enum_r_passwd(tctx, &pwd, &num_pwd),
+	torture_assert(tctx, test_enum_passwd(tctx, &pwd, &num_pwd),
 						"failed to enumerate passwd");
 
 	for (i=0; i < num_pwd; i++) {
@@ -533,6 +534,7 @@ static bool test_enum_group(struct torture_context *tctx,
 	return true;
 }
 
+#if HAVE_GETGRENT_R
 static bool test_enum_r_group(struct torture_context *tctx,
 			      struct group **grp_array_p,
 			      size_t *num_grp_p)
@@ -583,6 +585,7 @@ static bool test_enum_r_group(struct torture_context *tctx,
 
 	return true;
 }
+#endif
 
 static bool torture_assert_group_equal(struct torture_context *tctx,
 				       const struct group *g1,
@@ -639,7 +642,7 @@ static bool test_group_r(struct torture_context *tctx)
 	struct group *grp, grp1, grp2;
 	size_t num_grp;
 
-	torture_assert(tctx, test_enum_r_group(tctx, &grp, &num_grp),
+	torture_assert(tctx, test_enum_group(tctx, &grp, &num_grp),
 					       "failed to enumerate group");
 
 	for (i=0; i < num_grp; i++) {
@@ -667,7 +670,7 @@ static bool test_group_r_cross(struct torture_context *tctx)
 	struct group *grp, grp1, grp2, grp3, grp4;
 	size_t num_grp;
 
-	torture_assert(tctx, test_enum_r_group(tctx, &grp, &num_grp),
+	torture_assert(tctx, test_enum_group(tctx, &grp, &num_grp),
 					       "failed to enumerate group");
 
 	for (i=0; i < num_grp; i++) {
-- 
2.25.1