From: Stefan Metzmacher Date: Tue, 13 Jul 2021 22:14:24 +0000 (+0200) Subject: lib/param: enable "server multi channel support" by default on Linux and FreeBSD X-Git-Tag: samba-4.15.0rc1~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f03d7c85e62bec3f97143980ec45db8bd0e5383;p=thirdparty%2Fsamba.git lib/param: enable "server multi channel support" by default on Linux and FreeBSD Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- diff --git a/docs-xml/smbdotconf/protocol/servermultichannelsupport.xml b/docs-xml/smbdotconf/protocol/servermultichannelsupport.xml index 5f87298b4bd..105627139a5 100644 --- a/docs-xml/smbdotconf/protocol/servermultichannelsupport.xml +++ b/docs-xml/smbdotconf/protocol/servermultichannelsupport.xml @@ -10,17 +10,18 @@ This parameter was added with version 4.4. - Warning: Note that this feature is still considered experimental. - Use it at your own risk: Even though it may seem to work well in testing, - it may result in data corruption under some race conditions. - Future releases may improve this situation. + Note that this feature was still considered experimental up to 4.14. Due to dependencies to kernel APIs of Linux or FreeBSD, it's only possible to use this feature on Linux and FreeBSD for now. For testing this restriction can be overwritten by specifying force:server multi channel support=yes in addition. + + + This option is enabled by default starting with to 4.15 (on Linux and FreeBSD). + -no +yes diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c index 3bb711a5f19..b3dd77279cc 100644 --- a/lib/param/loadparm.c +++ b/lib/param/loadparm.c @@ -2924,6 +2924,8 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx) lpcfg_do_global_parameter(lp_ctx, "smb2 leases", "yes"); + lpcfg_do_global_parameter(lp_ctx, "server multi channel support", "yes"); + lpcfg_do_global_parameter(lp_ctx, "kerberos encryption types", "all"); lpcfg_do_global_parameter(lp_ctx, diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 23ca2cafbed..3b9cd1835fb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -867,6 +867,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals) Globals.smb2_max_trans = DEFAULT_SMB2_MAX_TRANSACT; Globals.smb2_max_credits = DEFAULT_SMB2_MAX_CREDITS; Globals.smb2_leases = true; + Globals.server_multi_channel_support = true; lpcfg_string_set(Globals.ctx, &Globals.ncalrpc_dir, get_dyn_NCALRPCDIR()); diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index 2d9f0d2cc74..82aa483055b 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -23,6 +23,7 @@ #include "system/network.h" #include "smbd/smbd.h" #include "smbd/globals.h" +#include "lib/param/param.h" #include "../libcli/smb/smb_common.h" #include "../lib/tsocket/tsocket.h" #include "../lib/util/tevent_ntstatus.h" @@ -1132,6 +1133,11 @@ bool smbXsrv_server_multi_channel_enabled(void) bool enabled = lp_server_multi_channel_support(); #ifndef __ALLOW_MULTI_CHANNEL_SUPPORT bool forced = false; + struct loadparm_context *lp_ctx = loadparm_init_s3(NULL, loadparm_s3_helpers()); + bool unspecified = lpcfg_parm_is_unspecified(lp_ctx, "server multi channel support"); + if (unspecified) { + enabled = false; + } /* * If we don't have support from the kernel * to ask for the un-acked number of bytes @@ -1147,6 +1153,7 @@ bool smbXsrv_server_multi_channel_enabled(void) "https://bugzilla.samba.org/show_bug.cgi?id=11897\n")); enabled = false; } + TALLOC_FREE(lp_ctx); #endif /* ! __ALLOW_MULTI_CHANNEL_SUPPORT */ return enabled; }