]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Don't idle connections with active SMB1 directory scans.
authorJeremy Allison <jra@samba.org>
Mon, 8 Jul 2019 21:55:09 +0000 (14:55 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 9 Jul 2019 23:12:16 +0000 (23:12 +0000)
When all scans are via file handles this code can
be removed.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/smbd/conn_idle.c

index 920d808862af472d55652988b88864734c51492c..52fa3ef2afa7e1d0477f69eddcb1e673117d3eb4 100644 (file)
@@ -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);