param: Add "smb3 unix extensions"
authorVolker Lendecke <vl@samba.org>
Thu, 25 Aug 2022 14:42:37 +0000 (16:42 +0200)
committerRalph Boehme <slow@samba.org>
Fri, 2 Sep 2022 13:31:38 +0000 (13:31 +0000)
Only available in DEVELOPER builds. Adding now to get some testing
step by step done.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
docs-xml/smbdotconf/protocol/smb3unixextensions.xml [new file with mode: 0644]
source3/param/loadparm.c
source3/param/loadparm.h
source3/smbd/smb2_negprot.c

diff --git a/docs-xml/smbdotconf/protocol/smb3unixextensions.xml b/docs-xml/smbdotconf/protocol/smb3unixextensions.xml
new file mode 100644 (file)
index 0000000..2dc3d61
--- /dev/null
@@ -0,0 +1,11 @@
+<samba:parameter name="smb3 unix extensions"
+                 context="G"
+                 type="boolean"
+                function="_smb3_unix_extensions"
+                 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
+  <description>
+    <para>Incomplete SMB 3.11 Unix Extensions. This is only available
+    if Samba is compiled in DEVELOPER mode.</para>
+  </description>
+  <value type="default">no</value>
+</samba:parameter>
index 43838575f3bfed7de35536a1555d233db75a4fce..91ad387e5dcfe4f7b62e7bfd6701b05aec608999 100644 (file)
@@ -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
 }
index 55a8926b9205f7a12192294e267f1c70ef87bd89..5ac8df1b980be5a3513afeb9c44bb8963b4d9db6 100644 (file)
@@ -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  */
 
index baddbecaade9d3a4ce1bcf14542cd5075304512f..2a1212a0ea52bca18e604a74b77fc9ebb332f261 100644 (file)
@@ -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);