From cb4244db53659fa082432521f8ac05bc1af2812c Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 6 Dec 2024 18:13:53 +0800 Subject: [PATCH] ksmbd: add SMB v1 support --- package/kernel/ksmbd/Makefile | 19 +++++++++++++++++++ .../patches/02-linux-is_dot_dotdot.patch | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/package/kernel/ksmbd/Makefile b/package/kernel/ksmbd/Makefile index 74b68b458a33de..1b11c89a5a2ed0 100644 --- a/package/kernel/ksmbd/Makefile +++ b/package/kernel/ksmbd/Makefile @@ -42,8 +42,27 @@ endef # The last two DEPENDS are hacks in order to get CONFIG_ASN1 and CONFIG_OID_REGISTRY # which it seems can't be selected independently. Some bug in either base or upstream. +define KernelPackage/fs-ksmbd/description + Ksmbd is an In-kernel SMBv(1)2/3 fileserver. + It's an implementation of the SMB protocol in kernel space for sharing files and IPC services over network. +endef +define KernelPackage/fs-ksmbd/config +config KSMBD_SMB_INSECURE_SERVER + bool "Support for insecure SMB1/CIFS and SMB2.0 protocols" + depends on PACKAGE_kmod-fs-ksmbd + help + This enables deprecated insecure protocols dialects: SMB1/CIFS and SMB2.0. + default n +endef +ifeq ($(CONFIG_KSMBD_SMB_INSECURE_SERVER),y) +PKG_EXTRA_KCONFIG:=CONFIG_SMB_INSECURE_SERVER=y +EXTRA_CFLAGS += -DCONFIG_SMB_INSECURE_SERVER=1 +endif + define Build/Compile $(KERNEL_MAKE) M="$(PKG_BUILD_DIR)" \ + EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ + $(PKG_EXTRA_KCONFIG) \ CONFIG_SMB_SERVER=m \ modules endef diff --git a/package/kernel/ksmbd/patches/02-linux-is_dot_dotdot.patch b/package/kernel/ksmbd/patches/02-linux-is_dot_dotdot.patch index 338cb250f7b9db..cba45cdc0dcdba 100644 --- a/package/kernel/ksmbd/patches/02-linux-is_dot_dotdot.patch +++ b/package/kernel/ksmbd/patches/02-linux-is_dot_dotdot.patch @@ -5,7 +5,7 @@ #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 9, 0) -+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 60) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 110) static inline bool is_dot_dotdot(const char *name, size_t len) { return len && unlikely(name[0] == '.') &&