https://www.samba.org/samba/history/samba-4.24.5.html
Patch removed due to fixed in Makefile:
012-fix-gnutls-version-check.patch
Patch removed because of no longer needed:
005-musl_uintptr.patch
Makefile:
Fixed gnutls sed related things.
Fixed compile_et & asn1_compile linkage at build time to fixes build error
Dropped NONE from bundled-libraries as to fix compilation errors, NONE
now seems meaning not to bundle any libraries.
Added RSTRIP from gcc Makefile to reduce compiled samba4 binaries and
libraries filesize by around 15%, tested, --private-libraries rpath
seems intact or identical with not-stripped binaries and libraries
one.
samba's cross_answer() returns on the *first* message matching a check in
cross-answers.txt, and Build/Configure copies the per-arch answers file
before appending its own answers. Up to samba 4.16 the check message
itself carried a "setting/geting hints" typo, which the generated answers
files inherited; samba fixed its spelling later, so the file entries
stopped matching and configure started aborting with
Cross answers file ... is incomplete
The 'Checking whether fcntl supports setting/getting hints: OK' line
appended by Build/Configure was added to paper over that, not because the
targets answer OK.
Now that the spelling in the answers files is fixed, the generated
(-11, "") entry matches first and the appended OK is dead code. Keep the
generated answer -- samba's test uses F_SET_FILE_RW_HINT/F_GET_FILE_RW_HINT,
which the kernel no longer implements, so the check legitimately fails on
every target -- and drop the unreachable echo so each check has exactly
one answer.
smb.conf.template:
Added SMB2 as default minimum protocol for client, also enabled server
& client encryption by default. Use smbpasswd -a username to add a
username & password for samba. To connect into samba from Windows 10
and above, it need to be done by this guide : https://www.asus.com/support/faq/
1054736/ .
Build system: x86/64
Build-tested: x86/64-glibc
Build-tested: x86/64-musl
Run-tested: x86/64-glibc
Signed-off-by: Aditya Nugraha <redacted>
include $(TOPDIR)/rules.mk
PKG_NAME:=samba
-PKG_VERSION:=4.22.7
-PKG_RELEASE:=3
+PKG_VERSION:=4.24.5
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:= \
https://ftp.riken.jp/net/samba/samba/stable/ \
https://www.nic.funet.fi/index/samba/pub/samba/stable/ \
https://download.samba.org/pub/samba/stable/
-PKG_HASH:=12195811d4542f661536e9055b44d58c53020412beafaae205e227bf72f6a497
+PKG_HASH:=6d5d7ee82f5ce9da4135086c9b184e47a58b4b023565f58abbb1f8c8a922306b
PKG_BUILD_FLAGS:=gc-sections
TARGET_CFLAGS += $(FPIC) -std=gnu17
TARGET_LDFLAGS += -Wl,--as-needed $(if $(filter arm armeb mips mipsel powerpc,$(ARCH)),-latomic)
-# dont mess with sambas private rpath!
-RSTRIP:=:
+STRIP:=$(firstword $(TOOLCHAIN_BIN_DIRS))/$(TARGET_CROSS)strip
+RSTRIP:= \
+ NM="$(firstword $(TOOLCHAIN_BIN_DIRS))/$(TARGET_CROSS)nm" \
+ STRIP="$(STRIP)" \
+ STRIP_KMOD="$(STRIP) --strip-debug" \
+ $(SCRIPT_DIR)/rstrip.sh
CONFIGURE_VARS += \
CPP="$(TARGET_CROSS)cpp" \
SYSTEM_BUNDLED_LIBS:=,uring
endif
ifeq ($(CONFIG_SAMBA4_SERVER_AD_DC),y)
- CONFIGURE_ARGS += --bundled-libraries=NONE,$(SYSTEM_PRIVATE_BUNDLED_LIBS)$(SYSTEM_BUNDLED_LIBS),$(PYTHON_BUNDLED_LIBS)
+ CONFIGURE_ARGS += --bundled-libraries=$(SYSTEM_PRIVATE_BUNDLED_LIBS)$(SYSTEM_BUNDLED_LIBS),$(PYTHON_BUNDLED_LIBS)
else
- CONFIGURE_ARGS += --bundled-libraries=NONE,$(SYSTEM_PRIVATE_BUNDLED_LIBS)$(SYSTEM_BUNDLED_LIBS)
+ CONFIGURE_ARGS += --bundled-libraries=$(SYSTEM_PRIVATE_BUNDLED_LIBS)$(SYSTEM_BUNDLED_LIBS)
endif
CONFIGURE_ARGS += --private-libraries=$(SYSTEM_PRIVATE_BUNDLED_LIBS)
$(call Host/Prepare/Default)
$(SED) 's,mandatory=True,mandatory=False,g' $(HOST_BUILD_DIR)/wscript_configure_system_gnutls
$(SED) 's,gnutls_version =.*,gnutls_version = gnutls_min_required_version,g' $(HOST_BUILD_DIR)/wscript_configure_system_gnutls
- $(SED) 's,gnutls_version_str.*,gnutls_version_str = "3.7.7",g' $(HOST_BUILD_DIR)/wscript_configure_system_gnutls
+ $(SED) 's,gnutls_version_str =.*,gnutls_version_str = "3.8.10",g' $(HOST_BUILD_DIR)/wscript_configure_system_gnutls
$(SED) 's,(gnutls_version > .*,(parse_version(gnutls_version) > parse_version("3.6.10")):,g' $(HOST_BUILD_DIR)/wscript_configure_system_gnutls
- $(SED) 's,(gnutls_version < .*,(parse_version(gnutls_version) < parse_version("3.5.2")):,g' $(HOST_BUILD_DIR)/wscript_configure_system_gnutls
+ $(SED) 's,(gnutls_version >= .*,(parse_version(gnutls_version) >= parse_version("3.5.2")):,g' $(HOST_BUILD_DIR)/wscript_configure_system_gnutls
endef
define Host/Compile
(cd $(HOST_BUILD_DIR); \
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
# Build via "waf install", avoid the make wrapper. (Samba logic is 'waf install' = build + install)
define Build/Compile
+ $(LN) $(STAGING_DIR_HOSTPKG)/bin/compile_et_samba $(PKG_BUILD_DIR)/bin/compile_et
+ $(LN) $(STAGING_DIR_HOSTPKG)/bin/asn1_compile_samba $(PKG_BUILD_DIR)/bin/asn1_compile
(cd $(PKG_BUILD_DIR); \
./buildtools/bin/waf install \
--jobs=$(shell nproc) \
unix charset = |CHARSET|
workgroup = |WORKGROUP|
+ client ipc min protocol = SMB2
+
## This global parameter allows the Samba admin to limit what interfaces on a machine will serve SMB requests.
bind interfaces only = yes
## This parameter controls whether a remote client is allowed or required to use SMB encryption.
## It has different effects depending on whether the connection uses SMB1 or SMB2 and newer:
- ## If the connection uses SMB1, then this option controls the use of a Samba-specific extension to the SMB protocol introduced in Samba 3.2 that makes use of the Unix extensions.
+ ## If the connection uses SMB1, then this option controls the use of a Samba-specific extension to the SMB protocol introduced in Samba 3.2 that makes use of the Unix extensions.
## If the connection uses SMB2 or newer, then this option controls the use of the SMB-level encryption that is supported in SMB version 3.0 and above and available in Windows 8 and newer.
## (default/auto,desired,required,off)
- #smb encrypt = default
+ smb encrypt = default
+ server signing = default
+ client smb encrypt = default
+ server smb encrypt = default
## set invalid users
invalid users = root
+++ /dev/null
-commit f81e5b71ce78f33250347914dacc75c8463bf102
-Author: Breno Leitao <breno.leitao@gmail.com>
-Date: Wed Mar 29 15:22:38 2017 -0300
-
- include: Check for previous declaration of uintptr_t
-
- Adding a extra check before declaring uintptr_t. Currently musl uses
- macro __DEFINED_uintptr_t once it defines uintptr_t type. Checking
- this macro before defining it, and, defining it when uintptr_t is
- defined.
-
- Signed-off-by: Breno Leitao <breno.leitao@gmail.com>
-
---- a/third_party/cmocka/cmocka.h
-+++ b/third_party/cmocka/cmocka.h
-@@ -111,7 +111,7 @@ typedef uintmax_t LargestIntegralType;
- ((LargestIntegralType)(value))
-
- /* Smallest integral type capable of holding a pointer. */
--#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED)
-+#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED) && !defined(__DEFINED_uintptr_t)
- # if defined(_WIN32)
- /* WIN32 is an ILP32 platform */
- typedef unsigned int uintptr_t;
-@@ -137,6 +137,8 @@ typedef uintmax_t LargestIntegralType;
-
- # define _UINTPTR_T
- # define _UINTPTR_T_DEFINED
-+# define __DEFINED_uintptr_t
-+
- #endif /* !defined(_UINTPTR_T) || !defined(_UINTPTR_T_DEFINED) */
-
- /* Perform an unsigned cast to uintptr_t. */
+From 2ea422f30999b4be543dc2cc5ce42b0e1c800e33 Mon Sep 17 00:00:00 2001
+From: Andy Walsh <andy.walsh44+github@gmail.com>
+Date: Sat, 29 Jan 2022 02:06:00 +0000
+Subject: [PATCH] Disable python module host check
+
+Disable detection for host's third party python module check.
+
+Signed-off-by: Andy Walsh <andy.walsh44+github@gmail.com>
+---
--- a/python/wscript
+++ b/python/wscript
-@@ -90,9 +90,9 @@ def configure(conf):
+@@ -103,9 +103,9 @@ def configure(conf):
"'python3-iso8601'. Please install "
"one of the packages.")
+++ /dev/null
---- 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
+From 09f99fbea292108d7fa9a09efc127200bddb9ef4 Mon Sep 17 00:00:00 2001
+From: Andy Walsh <andy.walsh44+github@gmail.com>
+Date: Tue, 17 Dec 2019 02:06:00 +0000
+Subject: [PATCH] Unbundle libbsd
+
+Remove libbsd dependency.
+
+Signed-off-by: Andy Walsh <andy.walsh44+github@gmail.com>
+---
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -441,33 +441,13 @@ def configure(conf):
- conf.CHECK_FUNCS('prctl dirname basename')
+ conf.CHECK_FUNCS('dirname basename')
- strlcpy_in_bsd = False
+ # Not checking for libbsd
+++ /dev/null
---- 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),
--- /dev/null
+From da434dc13dc6c7b0dc1cec13737e5d2d472d5d65 Mon Sep 17 00:00:00 2001
+From: John Audia <therealgraysky@proton.me>
+Date: Wed, 18 Jun 2025 02:06:00 +0000
+Subject: [PATCH] Fix build on aarch64 and riscv64
+
+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.
+
+Signed-off-by: John Audia <therealgraysky@proton.me>
+---
+--- a/lib/ldb/tests/test_ldb_comparison_fold.c
++++ b/lib/ldb/tests/test_ldb_comparison_fold.c
+@@ -53,7 +53,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),
Checking whether fcntl locking is available: OK
Checking whether fcntl lock supports open file description locks: NO
Checking whether fcntl supports flags to send direct I/O availability signals: OK
-Checking whether fcntl supports setting/geting hints: (-11, "")
+Checking whether fcntl supports setting/getting hints: (-11, "")
Checking for the maximum value of the 'time_t' type: OK
Checking whether the realpath function allows a NULL argument: OK
Checking for ftruncate extend: OK
Checking whether fcntl locking is available: OK
Checking whether fcntl lock supports open file description locks: NO
Checking whether fcntl supports flags to send direct I/O availability signals: OK
-Checking whether fcntl supports setting/geting hints: (-11, "")
+Checking whether fcntl supports setting/getting hints: (-11, "")
Checking for the maximum value of the 'time_t' type: NO
Checking whether the realpath function allows a NULL argument: OK
Checking for ftruncate extend: OK
Checking whether fcntl locking is available: OK
Checking whether fcntl lock supports open file description locks: NO
Checking whether fcntl supports flags to send direct I/O availability signals: OK
-Checking whether fcntl supports setting/geting hints: (-11, "")
+Checking whether fcntl supports setting/getting hints: (-11, "")
Checking for the maximum value of the 'time_t' type: NO
Checking whether the realpath function allows a NULL argument: OK
Checking for ftruncate extend: OK
Checking whether fcntl locking is available: OK
Checking whether fcntl lock supports open file description locks: NO
Checking whether fcntl supports flags to send direct I/O availability signals: OK
-Checking whether fcntl supports setting/geting hints: (-11, "")
+Checking whether fcntl supports setting/getting hints: (-11, "")
Checking for the maximum value of the 'time_t' type: NO
Checking whether the realpath function allows a NULL argument: OK
Checking for ftruncate extend: OK
Checking whether fcntl locking is available: OK
Checking whether fcntl lock supports open file description locks: NO
Checking whether fcntl supports flags to send direct I/O availability signals: OK
-Checking whether fcntl supports setting/geting hints: (-11, "")
+Checking whether fcntl supports setting/getting hints: (-11, "")
Checking for the maximum value of the 'time_t' type: NO
Checking whether the realpath function allows a NULL argument: OK
Checking for ftruncate extend: OK
Checking whether fcntl locking is available: OK
Checking whether fcntl lock supports open file description locks: NO
Checking whether fcntl supports flags to send direct I/O availability signals: OK
-Checking whether fcntl supports setting/geting hints: (-11, "")
+Checking whether fcntl supports setting/getting hints: (-11, "")
Checking for the maximum value of the 'time_t' type: NO
Checking whether the realpath function allows a NULL argument: OK
Checking for ftruncate extend: OK
Checking whether fcntl locking is available: OK
Checking whether fcntl lock supports open file description locks: NO
Checking whether fcntl supports flags to send direct I/O availability signals: OK
-Checking whether fcntl supports setting/geting hints: (-11, "")
+Checking whether fcntl supports setting/getting hints: (-11, "")
Checking for the maximum value of the 'time_t' type: OK
Checking whether the realpath function allows a NULL argument: OK
Checking for ftruncate extend: OK
Checking whether fcntl locking is available: OK
Checking whether fcntl lock supports open file description locks: NO
Checking whether fcntl supports flags to send direct I/O availability signals: OK
-Checking whether fcntl supports setting/geting hints: (-11, "")
+Checking whether fcntl supports setting/getting hints: (-11, "")
Checking for the maximum value of the 'time_t' type: OK
Checking whether the realpath function allows a NULL argument: OK
Checking for ftruncate extend: OK
Checking whether fcntl locking is available: OK
Checking whether fcntl lock supports open file description locks: NO
Checking whether fcntl supports flags to send direct I/O availability signals: OK
-Checking whether fcntl supports setting/geting hints: (-11, "")
+Checking whether fcntl supports setting/getting hints: (-11, "")
Checking for the maximum value of the 'time_t' type: NO
Checking whether the realpath function allows a NULL argument: OK
Checking for ftruncate extend: OK
Checking whether fcntl locking is available: OK
Checking whether fcntl lock supports open file description locks: NO
Checking whether fcntl supports flags to send direct I/O availability signals: OK
-Checking whether fcntl supports setting/geting hints: (-11, "")
+Checking whether fcntl supports setting/getting hints: (-11, "")
Checking for the maximum value of the 'time_t' type: NO
Checking whether the realpath function allows a NULL argument: OK
Checking for ftruncate extend: OK
Checking whether fcntl locking is available: OK
Checking whether fcntl lock supports open file description locks: NO
Checking whether fcntl supports flags to send direct I/O availability signals: OK
-Checking whether fcntl supports setting/geting hints: (-11, "")
+Checking whether fcntl supports setting/getting hints: (-11, "")
Checking for the maximum value of the 'time_t' type: OK
Checking whether the realpath function allows a NULL argument: OK
Checking for ftruncate extend: OK
Checking whether fcntl locking is available: OK
Checking whether fcntl lock supports open file description locks: NO
Checking whether fcntl supports flags to send direct I/O availability signals: OK
-Checking whether fcntl supports setting/geting hints: (-11, "")
+Checking whether fcntl supports setting/getting hints: (-11, "")
Checking for the maximum value of the 'time_t' type: OK
Checking whether the realpath function allows a NULL argument: OK
Checking for ftruncate extend: OK
Checking whether fcntl locking is available: OK
Checking whether fcntl lock supports open file description locks: NO
Checking whether fcntl supports flags to send direct I/O availability signals: OK
-Checking whether fcntl supports setting/geting hints: (-11, "")
+Checking whether fcntl supports setting/getting hints: (-11, "")
Checking for the maximum value of the 'time_t' type: OK
Checking whether the realpath function allows a NULL argument: OK
Checking for ftruncate extend: OK