Skip to contentSkip to conversation

samba: upgrade 4.19.9 -> 4.23.5

PATCH New Gyorgy Sarvari 1 participant 1 message Apr 11

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 samba: upgrade 4.19.9 -> 4.23.5

Samba has a new build-time dependency, libquic[1]. The repository builds an out-of-tree kernel module and a regular userspace library with the same build script, however the Makefile seems to be fairly hostile to cross-compilation. The Samba tarball also vendors the same with their own build script - for now, this venodred version is used.

There are some efforts that the kernel part is mainlined[2], once it happens it should be possible to easily remove this from the recipe.

pyldb was removed from RDEPENDS, as it seems that samba now builds its own version of it.

Patches updated, unneeded patches dropped. Some patches contained a considerable amount of whitespace changes - those were trimmed for the ease of rebasing.

Changelog:
https://gitlab.com/samba-team/samba/-/blob/samba-4.23.5/WHATSNEW.txt?ref_type=tags
(Switch to other branches to see earlier changelogs)

[1]: https://github.com/lxin/quic/
[2]: https://github.com/lxin/net-next/commits/quic/

---

v2: added use-xslt-replace-function-when-available.patch to avoid infinite
recursion when building documentation
v3: added "apply=no" tag to previously mentioned patch, instead of abusing the
"rev" with a non-existing value
v4: remove that patch altogether :)
As it is now part of oe-core.

 .../0001-Don-t-check-xsltproc-manpages.patch  |  19 +-
 ...3-Add-config-option-without-valgrind.patch |  11 +-
 ...eplace-memset_s-with-memset_explicit.patch | 117 +---------
 ...tions-to-configure-the-use-of-libbsd.patch |  50 ++--
 .../0004-lib-replace-Remove-memset_s.patch    | 217 +-----------------
 ...c43315d83c19514251a11c4fba5a137f2821.patch |  70 ------
 .../{samba_4.19.9.bb => samba_4.23.5.bb}      |  31 ++-
 7 files changed, 74 insertions(+), 441 deletions(-)
 delete mode 100644 meta-networking/recipes-connectivity/samba/samba/9aa5c43315d83c19514251a11c4fba5a137f2821.patch
 rename meta-networking/recipes-connectivity/samba/{samba_4.19.9.bb => samba_4.23.5.bb} (91%)
meta-networking/recipes-connectivity/samba/samba/0001-Don-t-check-xsltproc-manpages.patch +4 -15
index a498348c20..afa1154827 100644
@@ -9,25 +9,14 @@ Signed-off-by: Bian Naimeng <[email protected]>
 
 Rebase to 4.14.4
 Signed-off-by: Yi Zhao <[email protected]>
+
+Rebase to 4.23.5
+Signed-off-by: Gyorgy Sarvari <[email protected]>
 ---
- lib/ldb/wscript    | 2 +-
  lib/talloc/wscript | 2 +-
  lib/tdb/wscript    | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
+ 2 files changed, 2 insertions(+), 2 deletions(-)
 
-diff --git a/lib/ldb/wscript b/lib/ldb/wscript
-index ed5d45f..de3c648 100644
---- a/lib/ldb/wscript
-+++ b/lib/ldb/wscript
-@@ -144,7 +144,7 @@ def configure(conf):
-         conf.DEFINE('EXPECTED_SYSTEM_LDB_VERSION_RELEASE', int(v[2]))
- 
-     if conf.env.standalone_ldb:
--        conf.CHECK_XSLTPROC_MANPAGES()
-+        #conf.CHECK_XSLTPROC_MANPAGES()
- 
-         # we need this for the ldap backend
-         if conf.CHECK_FUNCS_IN('ber_flush ldap_open ldap_initialize', 'lber ldap', headers='lber.h ldap.h'):
 diff --git a/lib/talloc/wscript b/lib/talloc/wscript
 index 075f1ec..9bd9f73 100644
 --- a/lib/talloc/wscript
meta-networking/recipes-connectivity/samba/samba/0003-Add-config-option-without-valgrind.patch +4 -7
index 2c9d29c9fe..70e7f28cc7 100644
@@ -37,10 +37,10 @@ diff --git a/wscript b/wscript
 index 95ddd9e..6d9577a 100644
 --- a/wscript
 +++ b/wscript
-@@ -123,6 +123,13 @@ def options(opt):
+@@ -131,6 +131,13 @@
                    help=('Disable kernely keyring support for credential storage'),
                    action='store_false', dest='enable_keyring')
- 
+
 +    opt.add_option('--with-valgrind',
 +                   help=("Enable use of valgrind"),
 +                   action="store_true", dest='enable_valgrind')
@@ -48,9 +48,6 @@ index 95ddd9e..6d9577a 100644
 +                   help=("Disable use of valgrind"),
 +                   action="store_false", dest='enable_valgrind', default=False)
 +
-     gr = opt.option_group('developer options')
- 
-     opt.load('python') # options for disabling pyc or pyo compilation
--- 
-2.25.1
+     opt.samba_add_onoff_option('ldap')
 
+     opt.option_group('developer options')
meta-networking/recipes-connectivity/samba/samba/0003-Replace-memset_s-with-memset_explicit.patch +2 -115

132 lines not on this page · raw message

meta-networking/recipes-connectivity/samba/samba/0004-Add-options-to-configure-the-use-of-libbsd.patch +35 -15

82 lines not on this page · raw message

meta-networking/recipes-connectivity/samba/samba/0004-lib-replace-Remove-memset_s.patch +4 -213

237 lines not on this page · raw message

meta-networking/recipes-connectivity/samba/samba/9aa5c43315d83c19514251a11c4fba5a137f2821.patch deleted +0 -70

70 lines not on this page · raw message

meta-networking/recipes-connectivity/samba/samba_4.23.5.bb renamed from meta-networking/recipes-connectivity/samba/samba_4.19.9.bb +25 -6
similarity index 91%
rename from meta-networking/recipes-connectivity/samba/samba_4.19.9.bb
rename to meta-networking/recipes-connectivity/samba/samba_4.23.5.bb
index 3ed1d46754..ec3149562a 100644
@@ -14,6 +14,10 @@ ${SAMBA_MIRROR}    http://www.mirrorservice.org/sites/ftp.samba.org \n \
 
 export PYTHONHASHSEED = "1"
 
+# If XML_CATALOG_FILES env var is not defined, waf defaults
+# to build host folders looking for catalogs.
+export XML_CATALOG_FILES = ""
+
 SRC_URI = "${SAMBA_MIRROR}/stable/samba-${PV}.tar.gz \
            file://smb.conf \
            file://volatiles.03_samba \
@@ -24,7 +28,6 @@ SRC_URI = "${SAMBA_MIRROR}/stable/samba-${PV}.tar.gz \
            file://0005-Fix-pyext_PATTERN-for-cross-compilation.patch \
            file://0006-smbtorture-skip-test-case-tfork_cmd_send.patch \
            file://0007-Deleted-settiong-of-python-to-fix-the-install-confli.patch \
-           file://9aa5c43315d83c19514251a11c4fba5a137f2821.patch \
            file://0001-lib-replace-Implement-memset_explicit.patch \
            file://0002-lib-replace-Add-test-for-memset_explicit.patch \
            file://0003-Replace-memset_s-with-memset_explicit.patch \
@@ -36,7 +39,7 @@ SRC_URI:append:libc-musl = " \
            file://samba-4.3.9-remove-getpwent_r.patch \
            "
 
-SRC_URI[sha256sum] = "71ed406444714c90bb9d36c576d807b67af15449f297e91106d42b3ca2fa5549"
+SRC_URI[sha256sum] = "593a43ddd0d57902237dfa76888f7b02cb7fc7747111369cb31e126db4836b9f"
 
 UPSTREAM_CHECK_REGEX = "samba\-(?P<pver>4\.19(\.\d+)+).tar.gz"
 
@@ -47,7 +50,7 @@ CVE_STATUS[CVE-2011-2411] = "not-applicable-platform: vulnerable only on HP NonS
 # remove default added RDEPENDS on perl
 RDEPENDS:${PN}:remove = "perl"
 
-DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libldb libaio libpam libtasn1 libtasn1-native jansson libparse-yapp-perl-native gnutls cmocka"
+DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libaio libpam libtasn1 libtasn1-native jansson libparse-yapp-perl-native gnutls cmocka ngtcp2 bison-native"
 
 inherit features_check
 REQUIRED_DISTRO_FEATURES = "pam"
@@ -62,7 +65,7 @@ INITSCRIPT_NAME = "samba"
 INITSCRIPT_PARAMS = "start 20 3 5 . stop 20 0 1 6 ."
 
 SYSTEMD_PACKAGES = "${PN}-base ${PN}-ad-dc winbind ctdb"
-SYSTEMD_SERVICE:${PN}-base = "nmb.service smb.service"
+SYSTEMD_SERVICE:${PN}-base = "nmb.service smb.service samba-bgqd.service"
 SYSTEMD_SERVICE:${PN}-ad-dc = "${@bb.utils.contains('PACKAGECONFIG', 'ad-dc', 'samba.service', '', d)}"
 SYSTEMD_SERVICE:winbind = "winbind.service"
 SYSTEMD_SERVICE:ctdb = "ctdb.service"
@@ -109,7 +112,7 @@ SAMBA4_MODULES = "${SAMBA4_IDMAP_MODULES},${SAMBA4_PDB_MODULES},${SAMBA4_AUTH_MO
 # .so files so there will not be a conflict.  This is not done consistantly, so be very careful
 # when adding to this list.
 #
-SAMBA4_LIBS = "heimdal,NONE"
+SAMBA4_LIBS = "heimdal,libquic,NONE"
 
 EXTRA_OECONF += "--enable-fhs \
                  --with-piddir=/run \
@@ -132,6 +135,19 @@ EXTRA_OECONF += "--enable-fhs \
 
 LDFLAGS += "-Wl,-z,relro,-z,now"
 
+do_configure:prepend() {
+    # The xsltproc tool is actually a wrapper script in OE, which exports its own XML_CATALOG_FILES env var
+    # However samba does that too. So here I'm trying to concatenate the variables.
+    # The original looks like this in the wrapper:
+    # export XML_CATALOG_FILES=oe-core-specific-thing
+    # and this sed prepends the value with $XML_CATALOG_FILES, and encloses it in quotes. So the end value is
+    # export XML_CATALOG_FILES="$XML_CATALOG FILES oe-core-specific-thing"
+    # The first grep just checks if it was already done, so it is not prepended multiple times.
+
+    grep \$XML_CATALOG_FILES ${STAGING_BINDIR_NATIVE}/xsltproc || \
+        sed -i 's,\(XML_CATALOG_FILES\)=\(.*\),\1="\$XML_CATALOG_FILES \2",' ${STAGING_BINDIR_NATIVE}/xsltproc
+}
+
 do_configure:append() {
     cd ${S}/pidl/
     perl Makefile.PL PREFIX=${prefix}
@@ -213,6 +229,9 @@ do_install:append() {
     find ${D}${libdir}/perl5/ -type f -name "perllocal.pod" -delete
     find ${D}${libdir}/perl5/ -type f -name ".packlist" -delete
     sed -i -e '1s,#!.*perl,#!${bindir}/env perl,' ${D}${bindir}/pidl
+
+    sed -i 's,${UNPACKDIR},,g' ${S}/bin/default/libcli/wsp/wsp_aqs_lexer.c
+    sed -i 's,${UNPACKDIR},,g' ${S}/bin/default/libcli/wsp/wsp_aqs_lexer.h
 }
 
 PACKAGES =+ "${PN}-python3 ${PN}-pidl \
@@ -245,7 +264,7 @@ PACKAGESPLITFUNCS:prepend = "samba_populate_packages "
 PACKAGES_DYNAMIC = "samba-auth-.* samba-pdb-.*"
 
 RDEPENDS:${PN} += "${PN}-base ${PN}-python3 ${PN}-dsdb-modules python3"
-RDEPENDS:${PN}-python3 += "pytalloc python3-tdb pyldb"
+RDEPENDS:${PN}-python3 += "pytalloc python3-tdb"
 
 FILES:${PN}-base = "${sbindir}/nmbd \
                     ${sbindir}/smbd \