s3:smbd: also close durable file handles in a tdis
authorMichael Adam <obnox@samba.org>
Fri, 3 Aug 2012 14:38:38 +0000 (16:38 +0200)
committerStefan Metzmacher <metze@samba.org>
Sat, 8 Sep 2012 01:39:06 +0000 (03:39 +0200)
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

source3/smbd/files.c

index 0550b3115521d6310544847807c1979ffe19c115..ef229a4098a2f25a5c25f76afe0059db756678b9 100644 (file)
@@ -151,9 +151,16 @@ void file_close_conn(connection_struct *conn)
 
        for (fsp=conn->sconn->files; fsp; fsp=next) {
                next = fsp->next;
-               if (fsp->conn == conn) {
-                       close_file(NULL, fsp, SHUTDOWN_CLOSE);
+               if (fsp->conn != conn) {
+                       continue;
+               }
+               if (fsp->op != NULL && fsp->op->global->durable) {
+                       /*
+                        * A tree disconnect closes a durable handle
+                        */
+                       fsp->op->global->durable = false;
                }
+               close_file(NULL, fsp, SHUTDOWN_CLOSE);
        }
 }