diff options
| author | Khem Raj <raj.khem@gmail.com> | 2016-11-06 23:40:54 -0800 |
|---|---|---|
| committer | Joe MacDonald <joe_macdonald@mentor.com> | 2016-12-14 09:20:09 -0500 |
| commit | ef1c823a3fc4110d0717551fdb566ad7b251a649 (patch) | |
| tree | eaf3112d04c62267cfbe84c2fa5339a6938c05e8 | |
| parent | 961ed807dadb15108c7fdc020f66ec52c17310bf (diff) | |
| download | meta-openembedded-ef1c823a3fc4110d0717551fdb566ad7b251a649.tar.gz | |
samba: Fix build with musl
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
3 files changed, 130 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.2.7-pam.patch b/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.2.7-pam.patch new file mode 100644 index 0000000000..6b9ade920e --- /dev/null +++ b/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.2.7-pam.patch | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | Lifted from gentoo and ported to 4.4.5 | ||
| 2 | |||
| 3 | http://data.gpo.zugaina.org/musl/net-fs/samba/files/samba-4.2.7-pam.patch | ||
| 4 | |||
| 5 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 6 | |||
| 7 | |||
| 8 | Index: samba-4.4.5/source3/wscript | ||
| 9 | =================================================================== | ||
| 10 | --- samba-4.4.5.orig/source3/wscript | ||
| 11 | +++ samba-4.4.5/source3/wscript | ||
| 12 | @@ -873,7 +873,7 @@ msg.msg_accrightslen = sizeof(fd); | ||
| 13 | if conf.env.with_iconv: | ||
| 14 | conf.DEFINE('HAVE_ICONV', 1) | ||
| 15 | |||
| 16 | - if Options.options.with_pam: | ||
| 17 | + if Options.options.with_pam != False: | ||
| 18 | use_pam=True | ||
| 19 | conf.CHECK_HEADERS('security/pam_appl.h pam/pam_appl.h') | ||
| 20 | if not conf.CONFIG_SET('HAVE_SECURITY_PAM_APPL_H') and not conf.CONFIG_SET('HAVE_PAM_PAM_APPL_H'): | ||
| 21 | @@ -945,6 +945,15 @@ int i; i = PAM_RADIO_TYPE; | ||
| 22 | if use_pam: | ||
| 23 | conf.DEFINE('WITH_PAM', 1) | ||
| 24 | conf.DEFINE('WITH_PAM_MODULES', 1) | ||
| 25 | + else: | ||
| 26 | + Logs.warn("PAM disabled") | ||
| 27 | + use_pam=False | ||
| 28 | + conf.undefine('WITH_PAM') | ||
| 29 | + conf.undefine('WITH_PAM_MODULES') | ||
| 30 | + conf.undefine('HAVE_SECURITY_PAM_APPL_H') | ||
| 31 | + conf.undefine('PAM_RHOST') | ||
| 32 | + conf.undefine('PAM_TTY') | ||
| 33 | + conf.undefine('HAVE_PAM_PAM_APPL_H') | ||
| 34 | |||
| 35 | seteuid = False | ||
| 36 | |||
diff --git a/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.3.9-remove-getpwent_r.patch b/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.3.9-remove-getpwent_r.patch new file mode 100644 index 0000000000..71db99c5d2 --- /dev/null +++ b/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.3.9-remove-getpwent_r.patch | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | Musl does not have _r versions of getent() and getpwent() APIs | ||
| 2 | |||
| 3 | Taken from gentoo | ||
| 4 | http://data.gpo.zugaina.org/musl/net-fs/samba/files/samba-4.3.9-remove-getpwent_r.patch | ||
| 5 | |||
| 6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 7 | |||
| 8 | Index: samba-4.4.5/source4/torture/local/nss_tests.c | ||
| 9 | =================================================================== | ||
| 10 | --- samba-4.4.5.orig/source4/torture/local/nss_tests.c | ||
| 11 | +++ samba-4.4.5/source4/torture/local/nss_tests.c | ||
| 12 | @@ -247,7 +247,6 @@ static bool test_getgrnam_r(struct tortu | ||
| 13 | return true; | ||
| 14 | } | ||
| 15 | |||
| 16 | - | ||
| 17 | static bool test_getgrgid(struct torture_context *tctx, | ||
| 18 | gid_t gid, | ||
| 19 | struct group *grp_p) | ||
| 20 | @@ -333,6 +332,7 @@ static bool test_enum_passwd(struct tort | ||
| 21 | return true; | ||
| 22 | } | ||
| 23 | |||
| 24 | +#if HAVE_GETPWENT_R | ||
| 25 | static bool test_enum_r_passwd(struct torture_context *tctx, | ||
| 26 | struct passwd **pwd_array_p, | ||
| 27 | size_t *num_pwd_p) | ||
| 28 | @@ -381,6 +381,7 @@ static bool test_enum_r_passwd(struct to | ||
| 29 | |||
| 30 | return true; | ||
| 31 | } | ||
| 32 | +#endif | ||
| 33 | |||
| 34 | static bool torture_assert_passwd_equal(struct torture_context *tctx, | ||
| 35 | const struct passwd *p1, | ||
| 36 | @@ -432,7 +433,7 @@ static bool test_passwd_r(struct torture | ||
| 37 | struct passwd *pwd, pwd1, pwd2; | ||
| 38 | size_t num_pwd; | ||
| 39 | |||
| 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"); | ||
| 43 | |||
| 44 | for (i=0; i < num_pwd; i++) { | ||
| 45 | @@ -460,7 +461,7 @@ static bool test_passwd_r_cross(struct t | ||
| 46 | struct passwd *pwd, pwd1, pwd2, pwd3, pwd4; | ||
| 47 | size_t num_pwd; | ||
| 48 | |||
| 49 | - torture_assert(tctx, test_enum_r_passwd(tctx, &pwd, &num_pwd), | ||
| 50 | + torture_assert(tctx, test_enum_passwd(tctx, &pwd, &num_pwd), | ||
| 51 | "failed to enumerate passwd"); | ||
| 52 | |||
| 53 | for (i=0; i < num_pwd; i++) { | ||
| 54 | @@ -531,6 +532,7 @@ static bool test_enum_group(struct tortu | ||
| 55 | return true; | ||
| 56 | } | ||
| 57 | |||
| 58 | +#if HAVE_GETGRENT_R | ||
| 59 | static bool test_enum_r_group(struct torture_context *tctx, | ||
| 60 | struct group **grp_array_p, | ||
| 61 | size_t *num_grp_p) | ||
| 62 | @@ -579,6 +581,7 @@ static bool test_enum_r_group(struct tor | ||
| 63 | |||
| 64 | return true; | ||
| 65 | } | ||
| 66 | +#endif | ||
| 67 | |||
| 68 | static bool torture_assert_group_equal(struct torture_context *tctx, | ||
| 69 | const struct group *g1, | ||
| 70 | @@ -635,7 +638,7 @@ static bool test_group_r(struct torture_ | ||
| 71 | struct group *grp, grp1, grp2; | ||
| 72 | size_t num_grp; | ||
| 73 | |||
| 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"); | ||
| 77 | |||
| 78 | for (i=0; i < num_grp; i++) { | ||
| 79 | @@ -663,7 +666,7 @@ static bool test_group_r_cross(struct to | ||
| 80 | struct group *grp, grp1, grp2, grp3, grp4; | ||
| 81 | size_t num_grp; | ||
| 82 | |||
| 83 | - torture_assert(tctx, test_enum_r_group(tctx, &grp, &num_grp), | ||
| 84 | + torture_assert(tctx, test_enum_group(tctx, &grp, &num_grp), | ||
| 85 | "failed to enumerate group"); | ||
| 86 | |||
| 87 | for (i=0; i < num_grp; i++) { | ||
diff --git a/meta-networking/recipes-connectivity/samba/samba_4.4.5.bb b/meta-networking/recipes-connectivity/samba/samba_4.4.5.bb index e9694d4e9c..a27bcd1e6b 100644 --- a/meta-networking/recipes-connectivity/samba/samba_4.4.5.bb +++ b/meta-networking/recipes-connectivity/samba/samba_4.4.5.bb | |||
| @@ -20,6 +20,10 @@ SRC_URI = "${SAMBA_MIRROR}/stable/samba-${PV}.tar.gz \ | |||
| 20 | file://0006-avoid-using-colon-in-the-checking-msg.patch \ | 20 | file://0006-avoid-using-colon-in-the-checking-msg.patch \ |
| 21 | file://volatiles.03_samba \ | 21 | file://volatiles.03_samba \ |
| 22 | " | 22 | " |
| 23 | SRC_URI_append_libc-musl = " \ | ||
| 24 | file://samba-4.2.7-pam.patch \ | ||
| 25 | file://samba-4.3.9-remove-getpwent_r.patch \ | ||
| 26 | " | ||
| 23 | 27 | ||
| 24 | SRC_URI[md5sum] = "6950c5e9f7bdeb8a610c2ca957a15be4" | 28 | SRC_URI[md5sum] = "6950c5e9f7bdeb8a610c2ca957a15be4" |
| 25 | SRC_URI[sha256sum] = "b876ef2e63f66265490e80a122e66ef2d7616112b839df68f56ac2e1ce17a7bd" | 29 | SRC_URI[sha256sum] = "b876ef2e63f66265490e80a122e66ef2d7616112b839df68f56ac2e1ce17a7bd" |
| @@ -29,6 +33,9 @@ inherit systemd waf-samba cpan-base perlnative update-rc.d | |||
| 29 | RDEPENDS_${PN}_remove = "perl" | 33 | RDEPENDS_${PN}_remove = "perl" |
| 30 | 34 | ||
| 31 | DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libldb krb5 libbsd libaio libpam" | 35 | DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libldb krb5 libbsd libaio libpam" |
| 36 | DEPENDS_append_libc-musl = " libtirpc" | ||
| 37 | CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc" | ||
| 38 | LDFLAGS_append_libc-musl = " -ltirpc" | ||
| 32 | 39 | ||
| 33 | SYSVINITTYPE_linuxstdbase = "lsb" | 40 | SYSVINITTYPE_linuxstdbase = "lsb" |
| 34 | SYSVINITTYPE = "sysv" | 41 | SYSVINITTYPE = "sysv" |
