Browse Source

samba4: update to 4.12.3

* update to 4.12.3
* update/remove patches
* disable netbios port 139 on 'DISABLE_NETBIOS' option or missing 'nmbd'

Signed-off-by: Andy Walsh <andy.walsh44+github@gmail.com>
lilik-openwrt-22.03
Andy Walsh 5 years ago
parent
commit
f29cf74c28
7 changed files with 47 additions and 70 deletions
  1. +24
    -6
      net/samba4/Makefile
  2. +2
    -0
      net/samba4/files/samba.init
  3. +7
    -7
      net/samba4/patches/003-getpwent_r.patch
  4. +2
    -2
      net/samba4/patches/005-musl_uintptr.patch
  5. +0
    -22
      net/samba4/patches/009-samba-4.11-qsort-compar.patch
  6. +12
    -12
      net/samba4/patches/020-source3-msgsock-nvram-fix.patch
  7. +0
    -21
      net/samba4/patches/103-tmsize-overflow-fix.patch

+ 24
- 6
net/samba4/Makefile View File

@ -2,7 +2,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=samba PKG_NAME:=samba
PKG_VERSION:=4.11.6
PKG_VERSION:=4.12.3
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 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://www.nic.funet.fi/index/samba/pub/samba/stable/ \
http://samba.mirror.bit.nl/samba/ftp/stable/ \ http://samba.mirror.bit.nl/samba/ftp/stable/ \
https://download.samba.org/pub/samba/stable/ https://download.samba.org/pub/samba/stable/
PKG_HASH:=91438f4d7b71f673421435fa7f26b03b613f214139636ce50af35bc2ff09ef38
PKG_HASH:=3fadbca4504937820d0d8a34e500a1efdcc35e0c554f05bd0a844916ae528727
PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com> PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
PKG_LICENSE:=GPL-3.0-only PKG_LICENSE:=GPL-3.0-only
@ -21,7 +21,7 @@ PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:samba:samba PKG_CPE_ID:=cpe:/a:samba:samba
# samba4=(asn1_compile,compile_et) rpcsvc-proto=(rpcgen) # samba4=(asn1_compile,compile_et) rpcsvc-proto=(rpcgen)
HOST_BUILD_DEPENDS:=python3/host perl/host rpcsvc-proto/host
HOST_BUILD_DEPENDS:=python3/host rpcsvc-proto/host perl/host perl-parse-yapp/host
PKG_BUILD_DEPENDS:=samba4/host libtasn1/host PKG_BUILD_DEPENDS:=samba4/host libtasn1/host
PKG_CONFIG_DEPENDS:= \ PKG_CONFIG_DEPENDS:= \
@ -41,6 +41,7 @@ include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/version.mk
include ../../lang/python/python3-host.mk include ../../lang/python/python3-host.mk
include ../../lang/python/python3-package.mk include ../../lang/python/python3-package.mk
include ../../lang/perl/perlver.mk
define Package/samba4/Default define Package/samba4/Default
SECTION:=net SECTION:=net
@ -171,6 +172,7 @@ CONFIGURE_ARGS += \
--disable-cephfs \ --disable-cephfs \
--disable-fault-handling \ --disable-fault-handling \
--disable-glusterfs \ --disable-glusterfs \
--disable-spotlight \
--enable-fhs \ --enable-fhs \
--without-automount \ --without-automount \
--without-iconv \ --without-iconv \
@ -192,6 +194,7 @@ HOST_CONFIGURE_ARGS += \
--disable-cephfs \ --disable-cephfs \
--disable-fault-handling \ --disable-fault-handling \
--disable-glusterfs \ --disable-glusterfs \
--disable-spotlight \
--disable-rpath \ --disable-rpath \
--disable-rpath-install \ --disable-rpath-install \
--disable-rpath-private-install \ --disable-rpath-private-install \
@ -240,6 +243,9 @@ else
CONFIGURE_ARGS += --disable-avahi CONFIGURE_ARGS += --disable-avahi
endif endif
CONFIGURE_VARS += \
PERL="$(STAGING_DIR_HOSTPKG)/usr/bin/perl$(PERL_VERSION3)"
# NOTE: We need host python-bin, but target python-config here! # NOTE: We need host python-bin, but target python-config here!
CONFIGURE_VARS += python_LDFLAGS="" python_LIBDIR="" CONFIGURE_VARS += python_LDFLAGS="" python_LIBDIR=""
ifeq ($(CONFIG_SAMBA4_SERVER_AD_DC),y) ifeq ($(CONFIG_SAMBA4_SERVER_AD_DC),y)
@ -253,9 +259,9 @@ else
endif endif
SAMBA4_PDB_MODULES :=pdb_smbpasswd,pdb_tdbsam, SAMBA4_PDB_MODULES :=pdb_smbpasswd,pdb_tdbsam,
SAMBA4_AUTH_MODULES :=auth_builtin,auth_sam,auth_unix,auth_script,
SAMBA4_AUTH_MODULES :=auth_builtin,auth_sam,auth_unix,
SAMBA4_VFS_MODULES :=vfs_default, SAMBA4_VFS_MODULES :=vfs_default,
SAMBA4_VFS_MODULES_SHARED :=
SAMBA4_VFS_MODULES_SHARED :=auth_script,
ifeq ($(CONFIG_SAMBA4_SERVER_VFS),y) ifeq ($(CONFIG_SAMBA4_SERVER_VFS),y)
SAMBA4_VFS_MODULES_SHARED :=$(SAMBA4_VFS_MODULES_SHARED)vfs_fruit,vfs_shadow_copy2,vfs_recycle,vfs_fake_perms,vfs_readonly,vfs_cap,vfs_offline,vfs_crossrename,vfs_catia,vfs_streams_xattr,vfs_xattr_tdb,vfs_default_quota, SAMBA4_VFS_MODULES_SHARED :=$(SAMBA4_VFS_MODULES_SHARED)vfs_fruit,vfs_shadow_copy2,vfs_recycle,vfs_fake_perms,vfs_readonly,vfs_cap,vfs_offline,vfs_crossrename,vfs_catia,vfs_streams_xattr,vfs_xattr_tdb,vfs_default_quota,
ifeq ($(CONFIG_PACKAGE_kmod-fs-btrfs),y) ifeq ($(CONFIG_PACKAGE_kmod-fs-btrfs),y)
@ -305,10 +311,17 @@ CONFIGURE_ARGS += --private-libraries=$(SYSTEM_BUNDLED_LIBS)
export COMPILE_ET=$(STAGING_DIR_HOSTPKG)/bin/compile_et_samba export COMPILE_ET=$(STAGING_DIR_HOSTPKG)/bin/compile_et_samba
export ASN1_COMPILE=$(STAGING_DIR_HOSTPKG)/bin/asn1_compile_samba export ASN1_COMPILE=$(STAGING_DIR_HOSTPKG)/bin/asn1_compile_samba
# we dont need GnuTLS for the host helpers
# need to find host 'yapp'
HOST_CONFIGURE_VARS+= \
PATH="$(STAGING_DIR_HOSTPKG)/usr/bin:$(PATH)"
CONFIGURE_VARS += \
PATH="$(PATH):$(STAGING_DIR_HOSTPKG)/usr/bin"
# we dont need GnuTLS/Yapp for the host helpers
define Host/Prepare define Host/Prepare
$(call Host/Prepare/Default) $(call Host/Prepare/Default)
$(SED) 's,mandatory=True,mandatory=False,g' $(HOST_BUILD_DIR)/wscript_configure_system_gnutls $(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
endef endef
define Host/Compile define Host/Compile
(cd $(HOST_BUILD_DIR); \ (cd $(HOST_BUILD_DIR); \
@ -343,6 +356,11 @@ define Build/Configure
# NOTE: special answers for freeBSD/CircleCI # NOTE: special answers for freeBSD/CircleCI
echo 'Checking whether POSIX capabilities are available: OK' >> $(PKG_BUILD_DIR)/cross-answers.txt echo 'Checking whether POSIX capabilities are available: OK' >> $(PKG_BUILD_DIR)/cross-answers.txt
echo 'checking for clnt_create(): OK' >> $(PKG_BUILD_DIR)/cross-answers.txt echo 'checking for clnt_create(): OK' >> $(PKG_BUILD_DIR)/cross-answers.txt
# HACK: need to update WAF/qemu values (set to NO for now)
echo 'Checking value of GNUTLS_CIPHER_AES_128_CFB8: NO' >> $(PKG_BUILD_DIR)/cross-answers.txt
echo 'Checking value of GNUTLS_MAC_AES_CMAC_128: NO' >> $(PKG_BUILD_DIR)/cross-answers.txt
echo 'Checking whether fcntl supports flags to send direct I/O availability signals: NO' >> $(PKG_BUILD_DIR)/cross-answers.txt
echo 'Checking whether fcntl supports setting/geting hints: NO' >> $(PKG_BUILD_DIR)/cross-answers.txt
$(call Build/Configure/Default) $(call Build/Configure/Default)
endef endef


+ 2
- 0
net/samba4/files/samba.init View File

@ -50,6 +50,8 @@ smb_header() {
printf "\n######### Dynamic written config options #########\n" printf "\n######### Dynamic written config options #########\n"
if [ "$DISABLE_NETBIOS" -eq 1 ] || [ ! -x /usr/sbin/nmbd ]; then if [ "$DISABLE_NETBIOS" -eq 1 ] || [ ! -x /usr/sbin/nmbd ]; then
printf "\tdisable netbios = yes\n" printf "\tdisable netbios = yes\n"
# note: samba opens port 139 even if netbios is disabled via option above, so adjust listening ports
printf "\tsmb ports = 445\n"
fi fi
if [ "$DISABLE_ASYNC_IO" -eq 1 ]; then if [ "$DISABLE_ASYNC_IO" -eq 1 ]; then


+ 7
- 7
net/samba4/patches/003-getpwent_r.patch View File

@ -18,7 +18,7 @@ index 2cd6122..04f13c6 100644
static bool test_enum_r_passwd(struct torture_context *tctx, static bool test_enum_r_passwd(struct torture_context *tctx,
struct passwd **pwd_array_p, struct passwd **pwd_array_p,
size_t *num_pwd_p) size_t *num_pwd_p)
@@ -381,6 +381,7 @@ static bool test_enum_r_passwd(struct torture_context *tctx,
@@ -383,6 +383,7 @@ static bool test_enum_r_passwd(struct torture_context *tctx,
return true; return true;
} }
@ -26,7 +26,7 @@ index 2cd6122..04f13c6 100644
static bool torture_assert_passwd_equal(struct torture_context *tctx, static bool torture_assert_passwd_equal(struct torture_context *tctx,
const struct passwd *p1, const struct passwd *p1,
@@ -432,7 +433,7 @@ static bool test_passwd_r(struct torture_context *tctx)
@@ -434,7 +435,7 @@ static bool test_passwd_r(struct torture_context *tctx)
struct passwd *pwd, pwd1, pwd2; struct passwd *pwd, pwd1, pwd2;
size_t num_pwd; size_t num_pwd;
@ -35,7 +35,7 @@ index 2cd6122..04f13c6 100644
"failed to enumerate passwd"); "failed to enumerate passwd");
for (i=0; i < num_pwd; i++) { for (i=0; i < num_pwd; i++) {
@@ -460,7 +461,7 @@ static bool test_passwd_r_cross(struct torture_context *tctx)
@@ -462,7 +463,7 @@ static bool test_passwd_r_cross(struct torture_context *tctx)
struct passwd *pwd, pwd1, pwd2, pwd3, pwd4; struct passwd *pwd, pwd1, pwd2, pwd3, pwd4;
size_t num_pwd; size_t num_pwd;
@ -44,7 +44,7 @@ index 2cd6122..04f13c6 100644
"failed to enumerate passwd"); "failed to enumerate passwd");
for (i=0; i < num_pwd; i++) { for (i=0; i < num_pwd; i++) {
@@ -531,6 +532,7 @@ static bool test_enum_group(struct torture_context *tctx,
@@ -533,6 +534,7 @@ static bool test_enum_group(struct torture_context *tctx,
return true; return true;
} }
@ -52,7 +52,7 @@ index 2cd6122..04f13c6 100644
static bool test_enum_r_group(struct torture_context *tctx, static bool test_enum_r_group(struct torture_context *tctx,
struct group **grp_array_p, struct group **grp_array_p,
size_t *num_grp_p) size_t *num_grp_p)
@@ -579,6 +581,7 @@ static bool test_enum_r_group(struct torture_context *tctx,
@@ -583,6 +585,7 @@ static bool test_enum_r_group(struct torture_context *tctx,
return true; return true;
} }
@ -60,7 +60,7 @@ index 2cd6122..04f13c6 100644
static bool torture_assert_group_equal(struct torture_context *tctx, static bool torture_assert_group_equal(struct torture_context *tctx,
const struct group *g1, const struct group *g1,
@@ -635,7 +638,7 @@ static bool test_group_r(struct torture_context *tctx)
@@ -639,7 +642,7 @@ static bool test_group_r(struct torture_context *tctx)
struct group *grp, grp1, grp2; struct group *grp, grp1, grp2;
size_t num_grp; size_t num_grp;
@ -69,7 +69,7 @@ index 2cd6122..04f13c6 100644
"failed to enumerate group"); "failed to enumerate group");
for (i=0; i < num_grp; i++) { for (i=0; i < num_grp; i++) {
@@ -663,7 +666,7 @@ static bool test_group_r_cross(struct torture_context *tctx)
@@ -667,7 +670,7 @@ static bool test_group_r_cross(struct torture_context *tctx)
struct group *grp, grp1, grp2, grp3, grp4; struct group *grp, grp1, grp2, grp3, grp4;
size_t num_grp; size_t num_grp;


+ 2
- 2
net/samba4/patches/005-musl_uintptr.patch View File

@ -15,7 +15,7 @@ diff --git a/third_party/cmocka/cmocka.h b/third_party/cmocka/cmocka.h
index 303d0ae..a2bfc40 100644 index 303d0ae..a2bfc40 100644
--- a/third_party/cmocka/cmocka.h --- a/third_party/cmocka/cmocka.h
+++ b/third_party/cmocka/cmocka.h +++ b/third_party/cmocka/cmocka.h
@@ -110,7 +110,7 @@
@@ -111,7 +111,7 @@
((LargestIntegralType)(value)) ((LargestIntegralType)(value))
/* Smallest integral type capable of holding a pointer. */ /* Smallest integral type capable of holding a pointer. */
@ -24,7 +24,7 @@ index 303d0ae..a2bfc40 100644
# if defined(_WIN32) # if defined(_WIN32)
/* WIN32 is an ILP32 platform */ /* WIN32 is an ILP32 platform */
typedef unsigned int uintptr_t; typedef unsigned int uintptr_t;
@@ -136,6 +136,8 @@
@@ -137,6 +137,8 @@
# define _UINTPTR_T # define _UINTPTR_T
# define _UINTPTR_T_DEFINED # define _UINTPTR_T_DEFINED


+ 0
- 22
net/samba4/patches/009-samba-4.11-qsort-compar.patch View File

@ -1,22 +0,0 @@
diff --git a/source4/dsdb/samdb/ldb_modules/count_attrs.c b/source4/dsdb/samdb/ldb_modules/count_attrs.c
index b0d1b22..29f1b94 100644
--- a/source4/dsdb/samdb/ldb_modules/count_attrs.c
+++ b/source4/dsdb/samdb/ldb_modules/count_attrs.c
@@ -222,7 +222,7 @@ static const char **get_sorted_attrs(TALLOC_CTX *mem_ctx,
attrs[i] = a;
}
- qsort(attrs, n_attrs, sizeof(char *), (__compar_fn_t)strcasecmp_ptr);
+ qsort(attrs, n_attrs, sizeof(char *), (int (*)(const void *, const void *))strcasecmp_ptr);
return attrs;
}
@@ -313,7 +313,7 @@ static int count_attrs_search_callback(struct ldb_request *req,
}
qsort(found_attrs, msg->num_elements, sizeof(char *),
- (__compar_fn_t)strcasecmp_ptr);
+ (int (*)(const void *, const void *))strcasecmp_ptr);
/* find and report duplicates */

+ 12
- 12
net/samba4/patches/020-source3-msgsock-nvram-fix.patch View File

@ -1,6 +1,6 @@
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -518,7 +518,7 @@ static NTSTATUS messaging_init_internal(
--- a/source3/lib/messages.c 2020-02-28 09:59:35.000000000 +0100
+++ b/source3/lib/messages.c 2020-05-19 13:35:11.814566657 +0200
@@ -507,7 +507,7 @@ static NTSTATUS messaging_init_internal(
return NT_STATUS_ACCESS_DENIED; return NT_STATUS_ACCESS_DENIED;
} }
@ -9,12 +9,12 @@
if (priv_path == NULL) { if (priv_path == NULL) {
return NT_STATUS_NO_MEMORY; return NT_STATUS_NO_MEMORY;
} }
@@ -662,7 +662,7 @@ NTSTATUS messaging_reinit(struct messagi
msg_ctx->msg_dgm_ref = messaging_dgm_ref(
msg_ctx, msg_ctx->event_ctx, &msg_ctx->id.unique_id,
- private_path("msg.sock"), lck_path,
+ lock_path(talloc_tos(), "msg.sock"), lck_path,
messaging_recv_cb, msg_ctx, &ret);
if (msg_ctx->msg_dgm_ref == NULL) {
@@ -670,7 +670,7 @@ NTSTATUS messaging_reinit(struct messagi
msg_ctx->per_process_talloc_ctx,
msg_ctx->event_ctx,
&msg_ctx->id.unique_id,
- private_path("msg.sock"),
+ lock_path(talloc_tos(), "msg.sock"),
lck_path,
messaging_recv_cb,
msg_ctx,

+ 0
- 21
net/samba4/patches/103-tmsize-overflow-fix.patch View File

@ -1,21 +0,0 @@
--- a/source3/modules/vfs_fruit.c 2019-07-09
+++ b/source3/modules/vfs_fruit.c 2019-07-09
@@ -6995,12 +6995,12 @@ static bool fruit_tmsize_do_dirent(vfs_h
return true;
}
- if (bandsize > SIZE_MAX/nbands) {
- DBG_ERR("tmsize overflow: bandsize [%zu] nbands [%zu]\n",
- bandsize, nbands);
- return false;
- }
- tm_size = bandsize * nbands;
+ // if (bandsize > SIZE_MAX/nbands) {
+ // DBG_ERR("tmsize overflow: bandsize [%zu] nbands [%zu]\n",
+ // bandsize, nbands);
+ // return false;
+ // }
+ tm_size = (off_t)bandsize * (off_t)nbands;
if (state->total_size + tm_size < state->total_size) {
DBG_ERR("tmsize overflow: bandsize [%zu] nbands [%zu]\n",

Loading…
Cancel
Save