[PATCH] smbd: Move deadtime default to parameter definition and man page

Christof Schmitt cs at samba.org
Mon Apr 29 22:05:27 UTC 2019


From 0e61ae65dcb59e0ed0f83f5641db6f4163fee5f8 Mon Sep 17 00:00:00 2001
From: Christof Schmitt <cs at samba.org>
Date: Mon, 29 Apr 2019 11:01:44 -0700
Subject: [PATCH] smbd: Move deadtime default to parameter definition and man
 page

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 at samba.org>
---
 docs-xml/smbdotconf/tuning/deadtime.xml | 2 +-
 source3/include/local.h                 | 1 -
 source3/param/loadparm.c                | 2 +-
 source3/smbd/conn_idle.c                | 2 +-
 4 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/docs-xml/smbdotconf/tuning/deadtime.xml b/docs-xml/smbdotconf/tuning/deadtime.xml
index 7c60b90d097..77e0e5f9324 100644
--- a/docs-xml/smbdotconf/tuning/deadtime.xml
+++ b/docs-xml/smbdotconf/tuning/deadtime.xml
@@ -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>
diff --git a/source3/include/local.h b/source3/include/local.h
index c2be1ff3b7f..62700aace3c 100644
--- a/source3/include/local.h
+++ b/source3/include/local.h
@@ -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)
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 703460e4c47..5af1621fb9b 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -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;
diff --git a/source3/smbd/conn_idle.c b/source3/smbd/conn_idle.c
index 238b7bd7690..920d808862a 100644
--- a/source3/smbd/conn_idle.c
+++ b/source3/smbd/conn_idle.c
@@ -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) {
-- 
2.17.0



More information about the samba-technical mailing list