s3:smbd: call file_close_user() before removing tree connects in conn_close_all()
authorStefan Metzmacher <metze@samba.org>
Mon, 12 Mar 2012 17:04:01 +0000 (18:04 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 15 Mar 2012 20:56:09 +0000 (21:56 +0100)
This will help later if we have to handle a SMB2TreeDisconnect different
compared to a SMB2SessionLogoff and a TCPDisconnect.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Mar 15 21:56:09 CET 2012 on sn-devel-104

source3/smbd/conn_idle.c
source3/smbd/smb2_sesssetup.c

index dc213ea6be3308339e17291bcd25976a7eb9648f..f33bd8c89f77d48f5903d4c2ab0a2795575cae49 100644 (file)
@@ -88,12 +88,16 @@ bool conn_idle_all(struct smbd_server_connection *sconn, time_t t)
 bool conn_close_all(struct smbd_server_connection *sconn)
 {
        bool ret = false;
+
        if (sconn->using_smb2) {
                /* SMB2 */
                struct smbd_smb2_session *sess;
+
                for (sess = sconn->smb2.sessions.list; sess; sess = sess->next) {
                        struct smbd_smb2_tcon *tcon, *tc_next;
 
+                       file_close_user(sconn, sess->vuid);
+
                        for (tcon = sess->tcons.list; tcon; tcon = tc_next) {
                                tc_next = tcon->next;
                                TALLOC_FREE(tcon);
index 96e8d40cdde5a0afe14178f3b45a92188e190ea4..9a750eea0d67db653eacb4926ee80abc3697d603 100644 (file)
@@ -122,6 +122,8 @@ static int smbd_smb2_session_destructor(struct smbd_smb2_session *session)
                return 0;
        }
 
+       file_close_user(session->sconn, session->vuid);
+
        /* first free all tcons */
        while (session->tcons.list) {
                talloc_free(session->tcons.list);