smb2_tcon: only announce SMB2_SHARE_CAP_CLUSTER if rpcd_witness can run
authorStefan Metzmacher <metze@samba.org>
Thu, 8 Feb 2024 14:15:28 +0000 (15:15 +0100)
committerJule Anger <janger@samba.org>
Mon, 19 Feb 2024 14:31:13 +0000 (14:31 +0000)
rpcd_witness needs ncacn_ip_tcp support and that's only
available if samba-dcerpcd is not started on demand.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15577

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit d8bfdaaaa737032c6a8623512fcb2cd01850628a)

source3/smbd/smb2_tcon.c

index fca35e36ce5cc8cc6664d8d9a7ad2009fe8f45b0..8855202d7fd7cd491c031698e719b30c5f05181a 100644 (file)
@@ -428,6 +428,8 @@ static NTSTATUS smbd_smb2_tree_connect(struct smbd_smb2_request *req,
        if (*out_share_type == SMB2_SHARE_TYPE_DISK) {
                bool persistent = false; /* persistent handles not implemented yet */
                bool cluster = lp_clustering();
+               bool scaleout = cluster;
+               bool witness = cluster && !lp_rpc_start_on_demand_helpers();
                bool asymmetric = false; /* shares are symmetric by default */
                bool announce;
 
@@ -461,7 +463,7 @@ static NTSTATUS smbd_smb2_tree_connect(struct smbd_smb2_request *req,
                announce = lp_parm_bool(SNUM(tcon->compat),
                                        "smb3 share cap",
                                        "SCALE OUT",
-                                       cluster);
+                                       scaleout);
                if (announce) {
                        *out_capabilities |= SMB2_SHARE_CAP_SCALEOUT;
                }
@@ -472,7 +474,7 @@ static NTSTATUS smbd_smb2_tree_connect(struct smbd_smb2_request *req,
                announce = lp_parm_bool(SNUM(tcon->compat),
                                        "smb3 share cap",
                                        "CLUSTER",
-                                       cluster);
+                                       witness);
                if (announce) {
                        *out_capabilities |= SMB2_SHARE_CAP_CLUSTER;
                }