From 0f75963cf4c3b0d1b67ce7fc9513c0b578ec86f6 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 25 Aug 2022 16:42:37 +0200 Subject: [PATCH] param: Add "smb3 unix extensions" Only available in DEVELOPER builds. Adding now to get some testing step by step done. Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- docs-xml/smbdotconf/protocol/smb3unixextensions.xml | 11 +++++++++++ source3/param/loadparm.c | 13 ++++++++----- source3/param/loadparm.h | 2 +- source3/smbd/smb2_negprot.c | 2 +- 4 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 docs-xml/smbdotconf/protocol/smb3unixextensions.xml diff --git a/docs-xml/smbdotconf/protocol/smb3unixextensions.xml b/docs-xml/smbdotconf/protocol/smb3unixextensions.xml new file mode 100644 index 00000000000..2dc3d614c4f --- /dev/null +++ b/docs-xml/smbdotconf/protocol/smb3unixextensions.xml @@ -0,0 +1,11 @@ + + + Incomplete SMB 3.11 Unix Extensions. This is only available + if Samba is compiled in DEVELOPER mode. + + no + diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 43838575f3b..91ad387e5dc 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4673,8 +4673,8 @@ void widelinks_warning(int snum) "These parameters are incompatible. " "Wide links will be disabled for this share.\n", lp_const_servicename(snum)); - } else if (lp_smb2_unix_extensions()) { - DBG_ERR("Share '%s' has wide links and SMB2 unix " + } else if (lp_smb3_unix_extensions()) { + DBG_ERR("Share '%s' has wide links and SMB3 unix " "extensions enabled. " "These parameters are incompatible. " "Wide links will be disabled for this share.\n", @@ -4686,7 +4686,7 @@ void widelinks_warning(int snum) bool lp_widelinks(int snum) { /* wide links is always incompatible with unix extensions */ - if (lp_smb1_unix_extensions() || lp_smb2_unix_extensions()) { + if (lp_smb1_unix_extensions() || lp_smb3_unix_extensions()) { /* * Unless we have "allow insecure widelinks" * turned on. @@ -4827,8 +4827,11 @@ uint32_t lp_get_async_dns_timeout(void) return MAX(Globals.async_dns_timeout, 1); } -/* SMB2 POSIX extensions. For now, *always* disabled. */ -bool lp_smb2_unix_extensions(void) +bool lp_smb3_unix_extensions(void) { +#if defined(DEVELOPER) + return lp__smb3_unix_extensions(); +#else return false; +#endif } diff --git a/source3/param/loadparm.h b/source3/param/loadparm.h index 55a8926b920..5ac8df1b980 100644 --- a/source3/param/loadparm.h +++ b/source3/param/loadparm.h @@ -183,7 +183,7 @@ void widelinks_warning(int snum); const char *lp_ncalrpc_dir(void); void _lp_set_server_role(int server_role); uint32_t lp_get_async_dns_timeout(void); -bool lp_smb2_unix_extensions(void); +bool lp_smb3_unix_extensions(void); /* The following definitions come from param/loadparm_ctx.c */ diff --git a/source3/smbd/smb2_negprot.c b/source3/smbd/smb2_negprot.c index baddbecaade..2a1212a0ea5 100644 --- a/source3/smbd/smb2_negprot.c +++ b/source3/smbd/smb2_negprot.c @@ -274,7 +274,7 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req) return smbd_smb2_request_error(req, status); } - if (lp_smb2_unix_extensions()) { + if (lp_smb3_unix_extensions()) { in_posix = smb2_negotiate_context_find(&in_c, SMB2_POSIX_EXTENSIONS_AVAILABLE);