samba4: bump to 4.22.2
authorJohn Audia <[email protected]>
Mon, 2 Jun 2025 19:19:14 +0000 (15:19 -0400)
committerHannu Nyman <[email protected]>
Wed, 18 Jun 2025 14:51:32 +0000 (17:51 +0300)
https://www.samba.org/samba/history/samba-4.22.2.html

Removed upstreamed:
  101-do-not-check-xsltproc-manpages.patch
  105-perl-json-pp.patch

Removed due to build failure:
  104-samba-4.12-unbundle-icu.patch

Added:
  104-fix-build-on-aarch64-and-risc.patch[1]

Makefile:
  Removed section on --accel-aes due to upstream dropping support
  Added line to correct fcntl check in cross-answers.txt

1. For aarch64 and risc64, the discard_const macro is used to remove
const qualifiers from string literals, but casting a string literal’s
address to uintptr_t and then to void * is not a constant expression in
some compilers or environments e.g. the musl libc and aarch64/risc64
combination seems to enforce stricter rules for constant initializers
or pointer/integer size handling compared to glibc-based systems.

Build system: x86/64
Build-tested: x86/64
Run-tested: x86/64

Signed-off-by: John Audia <[email protected]>
net/samba4/Makefile
net/samba4/patches/009-samba-4-11-fix-host-tools-checks.patch.patch
net/samba4/patches/012-fix-gnutls-version-check.patch [new file with mode: 0644]
net/samba4/patches/020-source3-msgsock-nvram-fix.patch
net/samba4/patches/021-source4-msgsock-nvram-fix.patch
net/samba4/patches/101-do-not-check-xsltproc-manpages.patch
net/samba4/patches/102-samba-4.11-unbundle-libbsd.patch
net/samba4/patches/104-fix-build-on-aarch64-and-risc.patch [new file with mode: 0644]
net/samba4/patches/104-samba-4.12-unbundle-icu.patch [deleted file]
net/samba4/patches/105-perl-json-pp.patch [deleted file]

index 97345641c6c7de154830e2e3561a19ebf382d74e..52bf1ae48ecdc5dd1d3f23dc447bbf38bb053e57 100644 (file)
@@ -2,7 +2,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=samba
-PKG_VERSION:=4.18.8
+PKG_VERSION:=4.22.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
@@ -13,7 +13,7 @@ PKG_SOURCE_URL:= \
                http://www.nic.funet.fi/index/samba/pub/samba/stable/ \
                http://samba.mirror.bit.nl/samba/ftp/stable/ \
                https://download.samba.org/pub/samba/stable/
-PKG_HASH:=4fb87bceaeb01d832a59046c197a044b7e8e8000581548b5d577a6cda03344d1
+PKG_HASH:=d9ac8e224a200159e62c651cf42307dc162212ec25d04eb6800b9a7ccfbcc3c1
 
 PKG_BUILD_FLAGS:=gc-sections
 
@@ -217,14 +217,6 @@ HOST_CONFIGURE_ARGS += --disable-avahi --without-quotas --without-acl-support --
        --without-ad-dc --without-json --without-libarchive --disable-python --nopyc --nopyo \
        --without-ads --without-ldap --without-ldb-lmdb
 
-# Optional AES-NI support - https://lists.samba.org/archive/samba-technical/2017-September/122738.html
-# Support for Nettle wasn't comitted
-ifdef CONFIG_TARGET_x86_64
-       CONFIGURE_ARGS += --accel-aes=intelaesni
-else
-       CONFIGURE_ARGS += --accel-aes=none
-endif
-
 CONFIGURE_ARGS += \
                --with-lockdir=/var/lock \
                --with-logfilebase=/var/log \
@@ -371,6 +363,7 @@ define Build/Configure
        echo 'Checking uname version type: "$(VERSION_DIST) Linux-$(LINUX_VERSION) $(shell date +%Y-%m-%d)"' >> $(PKG_BUILD_DIR)/cross-answers.txt
        # NOTE: special answers for freeBSD/CircleCI
        echo 'checking for clnt_create(): OK' >> $(PKG_BUILD_DIR)/cross-answers.txt
+       echo 'Checking whether fcntl supports setting/getting hints: OK' >> $(PKG_BUILD_DIR)/cross-answers.txt
        $(call Build/Configure/Default)
 endef
 
index 4f06db369420ddb97abd51019f543cbf3d595d77..50fa9ec7e45fcc30305cf5d779969e38857023f0 100644 (file)
@@ -1,10 +1,9 @@
 --- a/wscript_configure_embedded_heimdal
 +++ b/wscript_configure_embedded_heimdal
-@@ -6,3 +6,14 @@ if not conf.env['BISON']:
+@@ -7,6 +7,17 @@ if not conf.env['BISON']:
  conf.define('USING_EMBEDDED_HEIMDAL', 1)
  conf.RECURSE('third_party/heimdal_build')
-+
 +def check_system_heimdal_binary(name):
 +    if conf.LIB_MAY_BE_BUNDLED(name):
 +        return False
@@ -15,3 +14,7 @@
 +
 +check_system_heimdal_binary("compile_et")
 +check_system_heimdal_binary("asn1_compile")
++
+ #
+ # See https://github.com/heimdal/heimdal/pull/1234
+ # and https://github.com/krb5/krb5/pull/1329
diff --git a/net/samba4/patches/012-fix-gnutls-version-check.patch b/net/samba4/patches/012-fix-gnutls-version-check.patch
new file mode 100644 (file)
index 0000000..96a0dff
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/wscript_configure_system_gnutls
++++ b/wscript_configure_system_gnutls
+@@ -36,7 +36,7 @@ if (gnutls_version > parse_version('3.6.
+ # GNUTLS_CB_TLS_SERVER_END_POINT is available with
+ # 3.7.2
+-if (gnutls_version >= parse_version('3.7.2')):
++if (gnutls_version > parse_version('3.7.2')):
+       conf.DEFINE('HAVE_GNUTLS_CB_TLS_SERVER_END_POINT', 1)
+ # Check if gnutls has fips mode support
index df5f56348d4f4f0a6814a7dab14fb4133b077be6..0a321450993cced3465ebcee44843d8a84331a40 100644 (file)
@@ -1,6 +1,6 @@
 --- a/source3/lib/messages.c
 +++ b/source3/lib/messages.c
-@@ -500,7 +500,7 @@ static NTSTATUS messaging_init_internal(
+@@ -501,7 +501,7 @@ static NTSTATUS messaging_init_internal(
                return NT_STATUS_ACCESS_DENIED;
        }
  
@@ -9,7 +9,7 @@
        if (priv_path == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
-@@ -663,7 +663,7 @@ NTSTATUS messaging_reinit(struct messagi
+@@ -664,7 +664,7 @@ NTSTATUS messaging_reinit(struct messagi
                msg_ctx->per_process_talloc_ctx,
                msg_ctx->event_ctx,
                &msg_ctx->id.unique_id,
index 2bd1e79c652f772a116b86a3d49ccac0a14dec86..8091d126f37ff4403fc10e0a5505603918b3141b 100644 (file)
@@ -1,6 +1,6 @@
 --- a/source4/lib/messaging/messaging.c
 +++ b/source4/lib/messaging/messaging.c
-@@ -526,7 +526,7 @@ static struct imessaging_context *imessa
+@@ -537,7 +537,7 @@ static struct imessaging_context *imessa
                goto fail;
        }
  
index abce345d8747bb81be8d2f8bfbf407f96b22ca9d..03c37298e6f88102a3b8fc2af30ab83ac091f9c0 100644 (file)
@@ -2,17 +2,6 @@ Don't check xsltproc manpages
 
 Signed-off-by: Bian Naimeng <[email protected]>
 
---- 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'):
 --- a/lib/talloc/wscript
 +++ b/lib/talloc/wscript
 @@ -48,7 +48,7 @@ def configure(conf):
index 766fefc522b1ef95337c94fadcdeb33a509fc757..c970dc8e5ebb3c1ce6ff79f3e77fa44b86b7bad2 100644 (file)
@@ -1,6 +1,6 @@
 --- a/lib/replace/wscript
 +++ b/lib/replace/wscript
-@@ -434,22 +434,13 @@ def configure(conf):
+@@ -441,33 +441,13 @@ def configure(conf):
  
      conf.CHECK_FUNCS('prctl dirname basename')
  
 -        if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
 -                               checklibc=True):
 -            strlcpy_in_bsd = True
+-    elif conf.env.enable_fuzzing:
+-        # Just to complicate it more, some versions of Honggfuzz have
+-        # got strlcpy and strlcat in libc, but not in <string.h>
+-        # (unless it is there coincidentally, on a BSD). Therefore we
+-        # can't use CHECK_FUNCS alone to decide whether to add the
+-        # headers to replace.h.
+-        #
+-        # As this is only known to happen on a fuzzing compiler, we'll
+-        # skip the check when not in fuzzing mode.
+-        conf.CHECK_HEADERS('bsd/string.h')
+-
 -    if not conf.CHECK_FUNCS('getpeereid'):
 -        conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
 -    if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
@@ -29,7 +40,7 @@
  
      conf.CHECK_CODE('''
                  struct ucred cred;
-@@ -832,9 +823,6 @@ syscall(SYS_copy_file_range,0,NULL,0,NUL
+@@ -850,9 +830,6 @@ syscall(SYS_copy_file_range,0,NULL,0,NUL
  
      # look for a method of finding the list of network interfaces
      for method in ['HAVE_IFACE_GETIFADDRS', 'HAVE_IFACE_AIX', 'HAVE_IFACE_IFCONF', 'HAVE_IFACE_IFREQ']:
@@ -39,7 +50,7 @@
          if conf.CHECK_CODE('''
                             #define %s 1
                             #define NO_CONFIG_H 1
-@@ -847,7 +835,7 @@ syscall(SYS_copy_file_range,0,NULL,0,NUL
+@@ -865,7 +842,7 @@ syscall(SYS_copy_file_range,0,NULL,0,NUL
                             #include "tests/getifaddrs.c"
                             ''' % method,
                             method,
@@ -48,7 +59,7 @@
                             addmain=False,
                             execute=True):
              break
-@@ -895,7 +883,6 @@ def build(bld):
+@@ -913,7 +890,6 @@ def build(bld):
                  break
  
      extra_libs = ''
diff --git a/net/samba4/patches/104-fix-build-on-aarch64-and-risc.patch b/net/samba4/patches/104-fix-build-on-aarch64-and-risc.patch
new file mode 100644 (file)
index 0000000..d6bd8f5
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/lib/ldb/tests/test_ldb_comparison_fold.c
++++ b/lib/ldb/tests/test_ldb_comparison_fold.c
+@@ -52,7 +52,7 @@ struct ranked_value {
+       int rank;
+ };
+-#define STR_VAL(s, r) { { discard_const(s), sizeof(s) - 1 }, r}
++#define STR_VAL(s, r) { { (void *)s, sizeof(s) - 1 }, r}
+ static const struct ranked_value values_common[] = {
+       STR_VAL("", 0),
diff --git a/net/samba4/patches/104-samba-4.12-unbundle-icu.patch b/net/samba4/patches/104-samba-4.12-unbundle-icu.patch
deleted file mode 100644 (file)
index bceaa1a..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
---- a/lib/util/charset/wscript_configure
-+++ b/lib/util/charset/wscript_configure
-@@ -37,15 +37,15 @@ conf.CHECK_CODE('''
-                 lib='iconv',
-                 headers='errno.h iconv.h')
--if conf.CHECK_CFG(package='icu-i18n',
--               args='--cflags --libs',
--               msg='Checking for icu-i18n',
--               uselib_store='ICU_I18N'):
--    for lib in conf.env['LIB_ICU_I18N']:
--        conf.CHECK_LIB(lib, shlib=True, mandatory=True)
--    conf.env['icu-libs'] = ' '.join(conf.env['LIB_ICU_I18N'])
--    if not conf.CHECK_HEADERS('unicode/ustring.h'):
--        conf.fatal('Found libicu, but unicode/ustring.h is missing')
--    conf.DEFINE('HAVE_UTF8_NORMALISATION', 1)
--else:
--    conf.env['icu-libs'] = ''
-+# if conf.CHECK_CFG(package='icu-i18n',
-+               # args='--cflags --libs',
-+               # msg='Checking for icu-i18n',
-+               # uselib_store='ICU_I18N'):
-+    # for lib in conf.env['LIB_ICU_I18N']:
-+        # conf.CHECK_LIB(lib, shlib=True, mandatory=True)
-+    # conf.env['icu-libs'] = ' '.join(conf.env['LIB_ICU_I18N'])
-+    # if not conf.CHECK_HEADERS('unicode/ustring.h'):
-+        # conf.fatal('Found libicu, but unicode/ustring.h is missing')
-+    # conf.DEFINE('HAVE_UTF8_NORMALISATION', 1)
-+# else:
-+conf.env['icu-libs'] = ''
diff --git a/net/samba4/patches/105-perl-json-pp.patch b/net/samba4/patches/105-perl-json-pp.patch
deleted file mode 100644 (file)
index feb8aaa..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/third_party/heimdal/cf/make-proto.pl
-+++ b/third_party/heimdal/cf/make-proto.pl
-@@ -4,7 +4,7 @@
- use Getopt::Std;
- use File::Compare;
--use JSON;
-+use JSON::PP;
- my $comment = 0;
- my $doxygen = 0;
-@@ -70,7 +70,7 @@ if($opt_x) {
-     my $EXP;
-     local $/;
-     open(EXP, '<', $opt_x) || die "open ${opt_x}";
--    my $obj = JSON->new->utf8->decode(<EXP>);
-+    my $obj = JSON::PP->new->utf8->decode(<EXP>);
-     close $EXP;
-     foreach my $x (keys %$obj) {