Squashed 'import-layers/meta-openembedded/' changes from df3537259..b40116cf4

Yocto 2.2.2 (Morty)

Change-Id: I3998555f14538d8306be995bcfb366173e04e975
git-subtree-dir: import-layers/meta-openembedded
git-subtree-split: b40116cf457b88a2db14b86fda9627fb34d56ae6
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch
new file mode 100644
index 0000000..0ab3436
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Submitted [https://github.com/samba-team/samba/pull/70]
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+
+From 50eac4fd30944e5e1d83060757633fe0ed572723 Mon Sep 17 00:00:00 2001
+From: Andreas Oberritter <obi@opendreambox.org>
+Date: Wed, 30 Nov 2016 16:25:06 +0100
+Subject: [PATCH] packaging: Avoid timeout for nmbd if started offline with
+ systemd
+
+If no network connection appears within DefaultTimeoutStartSec
+(~ 90s) after startup, nmbd fails to notify systemd and will
+therefore get killed.
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+---
+ packaging/systemd/nmb.service | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/packaging/systemd/nmb.service b/packaging/systemd/nmb.service
+index 992c0cd..555c9ab 100644
+--- a/packaging/systemd/nmb.service
++++ b/packaging/systemd/nmb.service
+@@ -10,6 +10,7 @@ EnvironmentFile=-/etc/sysconfig/samba
+ ExecStart=/usr/sbin/nmbd $NMBDOPTIONS
+ ExecReload=/usr/bin/kill -HUP $MAINPID
+ LimitCORE=infinity
++TimeoutStartSec=0
+ 
+ [Install]
+ WantedBy=multi-user.target
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.2.7-pam.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.2.7-pam.patch
new file mode 100644
index 0000000..6b9ade9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.2.7-pam.patch
@@ -0,0 +1,36 @@
+Lifted from gentoo and ported to 4.4.5
+
+http://data.gpo.zugaina.org/musl/net-fs/samba/files/samba-4.2.7-pam.patch
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+
+Index: samba-4.4.5/source3/wscript
+===================================================================
+--- samba-4.4.5.orig/source3/wscript
++++ samba-4.4.5/source3/wscript
+@@ -873,7 +873,7 @@ msg.msg_accrightslen = sizeof(fd);
+         if conf.env.with_iconv:
+             conf.DEFINE('HAVE_ICONV', 1)
+ 
+-    if Options.options.with_pam:
++    if Options.options.with_pam != False:
+         use_pam=True
+         conf.CHECK_HEADERS('security/pam_appl.h pam/pam_appl.h')
+         if not conf.CONFIG_SET('HAVE_SECURITY_PAM_APPL_H') and not conf.CONFIG_SET('HAVE_PAM_PAM_APPL_H'):
+@@ -945,6 +945,15 @@ int i; i = PAM_RADIO_TYPE;
+         if use_pam:
+             conf.DEFINE('WITH_PAM', 1)
+             conf.DEFINE('WITH_PAM_MODULES', 1)
++    else:
++        Logs.warn("PAM disabled")
++        use_pam=False
++        conf.undefine('WITH_PAM')
++        conf.undefine('WITH_PAM_MODULES')
++        conf.undefine('HAVE_SECURITY_PAM_APPL_H')
++        conf.undefine('PAM_RHOST')
++        conf.undefine('PAM_TTY')
++        conf.undefine('HAVE_PAM_PAM_APPL_H')
+ 
+     seteuid = False
+ 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.3.9-remove-getpwent_r.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.3.9-remove-getpwent_r.patch
new file mode 100644
index 0000000..71db99c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.3.9-remove-getpwent_r.patch
@@ -0,0 +1,87 @@
+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
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: samba-4.4.5/source4/torture/local/nss_tests.c
+===================================================================
+--- samba-4.4.5.orig/source4/torture/local/nss_tests.c
++++ samba-4.4.5/source4/torture/local/nss_tests.c
+@@ -247,7 +247,6 @@ static bool test_getgrnam_r(struct tortu
+ 	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 tort
+ 	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)
+@@ -381,6 +381,7 @@ static bool test_enum_r_passwd(struct to
+ 
+ 	return true;
+ }
++#endif
+ 
+ static bool torture_assert_passwd_equal(struct torture_context *tctx,
+ 					const struct passwd *p1,
+@@ -432,7 +433,7 @@ static bool test_passwd_r(struct torture
+ 	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++) {
+@@ -460,7 +461,7 @@ static bool test_passwd_r_cross(struct t
+ 	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++) {
+@@ -531,6 +532,7 @@ static bool test_enum_group(struct tortu
+ 	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)
+@@ -579,6 +581,7 @@ static bool test_enum_r_group(struct tor
+ 
+ 	return true;
+ }
++#endif
+ 
+ static bool torture_assert_group_equal(struct torture_context *tctx,
+ 				       const struct group *g1,
+@@ -635,7 +638,7 @@ static bool test_group_r(struct torture_
+ 	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++) {
+@@ -663,7 +666,7 @@ static bool test_group_r_cross(struct to
+ 	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++) {