samba: fix compile with musl toolchain
[openadk.git] / package / samba / patches / patch-source4_torture_local_nss_tests_c
blobbb6ed3fb29904ac80584786ec099b7085e710e56
1 --- samba-4.6.6.orig/source4/torture/local/nss_tests.c  2017-01-09 09:12:33.000000000 +0100
2 +++ samba-4.6.6/source4/torture/local/nss_tests.c       2017-08-03 07:58:11.514847082 +0200
3 @@ -247,7 +247,6 @@ static bool test_getgrnam_r(struct tortu
4         return true;
5  }
6  
8  static bool test_getgrgid(struct torture_context *tctx,
9                           gid_t gid,
10                           struct group *grp_p)
11 @@ -333,6 +332,7 @@ static bool test_enum_passwd(struct tort
12         return true;
13  }
15 +#if HAVE_GETPWENT_R
16  static bool test_enum_r_passwd(struct torture_context *tctx,
17                                struct passwd **pwd_array_p,
18                                size_t *num_pwd_p)
19 @@ -381,6 +381,7 @@ static bool test_enum_r_passwd(struct to
21         return true;
22  }
23 +#endif
25  static bool torture_assert_passwd_equal(struct torture_context *tctx,
26                                         const struct passwd *p1,
27 @@ -432,7 +433,7 @@ static bool test_passwd_r(struct torture
28         struct passwd *pwd, pwd1, pwd2;
29         size_t num_pwd;
31 -       torture_assert(tctx, test_enum_r_passwd(tctx, &pwd, &num_pwd),
32 +       torture_assert(tctx, test_enum_passwd(tctx, &pwd, &num_pwd),
33                                                 "failed to enumerate passwd");
35         for (i=0; i < num_pwd; i++) {
36 @@ -460,7 +461,7 @@ static bool test_passwd_r_cross(struct t
37         struct passwd *pwd, pwd1, pwd2, pwd3, pwd4;
38         size_t num_pwd;
40 -       torture_assert(tctx, test_enum_r_passwd(tctx, &pwd, &num_pwd),
41 +       torture_assert(tctx, test_enum_passwd(tctx, &pwd, &num_pwd),
42                                                 "failed to enumerate passwd");
44         for (i=0; i < num_pwd; i++) {
45 @@ -531,6 +532,7 @@ static bool test_enum_group(struct tortu
46         return true;
47  }
49 +#if HAVE_GETGRENT_R
50  static bool test_enum_r_group(struct torture_context *tctx,
51                               struct group **grp_array_p,
52                               size_t *num_grp_p)
53 @@ -579,6 +581,7 @@ static bool test_enum_r_group(struct tor
55         return true;
56  }
57 +#endif
59  static bool torture_assert_group_equal(struct torture_context *tctx,
60                                        const struct group *g1,
61 @@ -635,7 +638,7 @@ static bool test_group_r(struct torture_
62         struct group *grp, grp1, grp2;
63         size_t num_grp;
65 -       torture_assert(tctx, test_enum_r_group(tctx, &grp, &num_grp),
66 +       torture_assert(tctx, test_enum_group(tctx, &grp, &num_grp),
67                                                "failed to enumerate group");
69         for (i=0; i < num_grp; i++) {
70 @@ -663,7 +666,7 @@ static bool test_group_r_cross(struct to
71         struct group *grp, grp1, grp2, grp3, grp4;
72         size_t num_grp;
74 -       torture_assert(tctx, test_enum_r_group(tctx, &grp, &num_grp),
75 +       torture_assert(tctx, test_enum_group(tctx, &grp, &num_grp),
76                                                "failed to enumerate group");
78         for (i=0; i < num_grp; i++) {