From: Jeremy Allison Date: Mon, 8 Jul 2019 21:55:09 +0000 (-0700) Subject: s3: smbd: Don't idle connections with active SMB1 directory scans. X-Git-Tag: talloc-2.3.0~144 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=461001cbc13727b46b0ff3fb8ea347bfc199a9e4;p=thirdparty%2Fsamba.git s3: smbd: Don't idle connections with active SMB1 directory scans. When all scans are via file handles this code can be removed. Signed-off-by: Jeremy Allison Reviewed-by: Andreas Schneider --- diff --git a/source3/smbd/conn_idle.c b/source3/smbd/conn_idle.c index 920d808862a..52fa3ef2afa 100644 --- a/source3/smbd/conn_idle.c +++ b/source3/smbd/conn_idle.c @@ -59,6 +59,16 @@ bool conn_idle_all(struct smbd_server_connection *sconn, time_t t) for (conn=sconn->connections;conn;conn=conn->next) { time_t age = t - conn->lastused; + /* + * Don't idle connections with active + * SMB1 directory scans. When all scans + * are via file handles this code can + * be removed. + */ + if (dptr_activecnum(sconn, conn)) { + return false; + } + /* close dirptrs on connections that are idle */ if (age > DPTR_IDLE_TIMEOUT) { dptr_idlecnum(conn);