smbd: Move deadtime default to parameter definition and man page
authorChristof Schmitt <cs@samba.org>
Mon, 29 Apr 2019 18:01:44 +0000 (11:01 -0700)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 1 May 2019 03:12:07 +0000 (03:12 +0000)
The code has a default of one week (10080 minutes) if the parameter is
set to 0. Make this the public default of the parameter, instead of
hiding it in the code. This change also has the code match the
documentation that setting this parameter to 0 disables the check.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
docs-xml/smbdotconf/tuning/deadtime.xml
lib/param/loadparm.c
source3/include/local.h
source3/param/loadparm.c
source3/smbd/conn_idle.c

index 7c60b90d097528a9cced3759d58951ef20fa1da0..77e0e5f932461ee23ac1290f854b74bf9f51b4a1 100644 (file)
@@ -22,6 +22,6 @@
                should be performed.</para>
 </description>
 
-<value type="default">0</value>
+<value type="default">10080</value>
 <value type="example">15</value>
 </samba:parameter>
index ebbccc22b71b5e863f9dee02e4c9d8eea862212f..e03c1556d7e04a487d574342939a0f5ed489e0f9 100644 (file)
@@ -2833,6 +2833,8 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
 
        lpcfg_do_global_parameter(lp_ctx, "passdb backend", "tdbsam");
 
+       lpcfg_do_global_parameter(lp_ctx, "deadtime", "10080");
+
        lpcfg_do_global_parameter(lp_ctx, "getwd cache", "True");
 
        lpcfg_do_global_parameter(lp_ctx, "winbind nested groups", "True");
index c2be1ff3b7fd57c4df9e4e6771876cf42c401337..62700aace3c26096648c71f8a851e523b96de8bd 100644 (file)
@@ -96,7 +96,6 @@
 
 /* the following control timings of various actions. Don't change 
    them unless you know what you are doing. These are all in seconds */
-#define DEFAULT_SMBD_TIMEOUT (60*60*24*7)
 #define SMBD_RELOAD_CHECK (180)
 #define IDLE_CLOSED_TIMEOUT (60)
 #define DPTR_IDLE_TIMEOUT (120)
index 703460e4c474cf8463330bdf301504532f7edf3e..5af1621fb9b0905515926bb2318f6c0e8b8d5caa 100644 (file)
@@ -641,7 +641,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
        Globals._disable_spoolss = false;
        Globals.max_smbd_processes = 0;/* no limit specified */
        Globals.username_level = 0;
-       Globals.deadtime = 0;
+       Globals.deadtime = 10080;
        Globals.getwd_cache = true;
        Globals.large_readwrite = true;
        Globals.max_log_size = 5000;
index 238b7bd76901ef4324db85e089e173050069c302..920d808862af472d55652988b88864734c51492c 100644 (file)
@@ -53,7 +53,7 @@ bool conn_idle_all(struct smbd_server_connection *sconn, time_t t)
        conn_lastused_update(sconn, t);
 
        if (deadtime <= 0) {
-               deadtime = DEFAULT_SMBD_TIMEOUT;
+               return false;
        }
 
        for (conn=sconn->connections;conn;conn=conn->next) {