param: move SMB2 defaults to lib/param and use in loadparm_init
authorGarming Sam <garming@catalyst.net.nz>
Thu, 16 Jan 2014 00:32:42 +0000 (13:32 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 12 Feb 2014 00:17:14 +0000 (13:17 +1300)
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
lib/param/loadparm.c
lib/param/loadparm.h
source3/include/local.h

index 9795614affd8f9a48fe8d5851e3c7c02948a29e3..038f5dc28507558aee03b3b430f6ad42d1356234 100644 (file)
@@ -2206,7 +2206,7 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
 
        lpcfg_do_global_parameter(lp_ctx, "enable privileges", "True");
 
-       lpcfg_do_global_parameter(lp_ctx, "smb2 max write", "1048576");
+       lpcfg_do_global_parameter_var(lp_ctx, "smb2 max write", "%u", DEFAULT_SMB2_MAX_WRITE);
 
        lpcfg_do_global_parameter(lp_ctx, "passdb backend", "tdbsam");
 
@@ -2216,7 +2216,7 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
 
        lpcfg_do_global_parameter(lp_ctx, "mangled names", "True");
 
-       lpcfg_do_global_parameter(lp_ctx, "smb2 max credits", "8192");
+       lpcfg_do_global_parameter_var(lp_ctx, "smb2 max credits", "%u", DEFAULT_SMB2_MAX_CREDITS);
 
        lpcfg_do_global_parameter(lp_ctx, "ldap ssl", "start tls");
 
@@ -2304,9 +2304,9 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
 
        lpcfg_do_global_parameter(lp_ctx, "lpq cache time", "30");
 
-       lpcfg_do_global_parameter(lp_ctx, "smb2 max trans", "1048576");
+       lpcfg_do_global_parameter_var(lp_ctx, "smb2 max trans", "%u", DEFAULT_SMB2_MAX_TRANSACT);
 
-       lpcfg_do_global_parameter(lp_ctx, "smb2 max read", "1048576");
+       lpcfg_do_global_parameter_var(lp_ctx, "smb2 max read", "%u", DEFAULT_SMB2_MAX_READ);
 
        lpcfg_do_global_parameter(lp_ctx, "durable handles", "yes");
 
index fffdee23b786dfc937fc36778be50e19b5a6bb0d..56ffec524db59dce561b85ba61a7e59bce965697 100644 (file)
@@ -208,6 +208,12 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 #define GUEST_ACCOUNT "nobody"
 #endif
 
+/* SMB2 defaults */
+#define DEFAULT_SMB2_MAX_READ (1024*1024)
+#define DEFAULT_SMB2_MAX_WRITE (1024*1024)
+#define DEFAULT_SMB2_MAX_TRANSACT (1024*1024)
+#define DEFAULT_SMB2_MAX_CREDITS 8192
+
 #define LOADPARM_EXTRA_LOCALS                                          \
        bool valid;                                                     \
        int usershare;                                                  \
index d72c084bc486ae90e31420e2f67bdeaec9787bae..85f086151a4ea8317405702f9cecd02b0b18951d 100644 (file)
 #define CLIENT_NDR_PADDING_SIZE 8
 #define SERVER_NDR_PADDING_SIZE 8
 
-#define DEFAULT_SMB2_MAX_READ (1024*1024)
-#define DEFAULT_SMB2_MAX_WRITE (1024*1024)
-#define DEFAULT_SMB2_MAX_TRANSACT (1024*1024)
-#define DEFAULT_SMB2_MAX_CREDITS 8192
-
 #endif