{
NTSTATUS status;
DATA_BLOB outbody;
- struct connection_struct *conn, *next_conn;
status = smbd_smb2_request_verify_sizes(req, 0x04);
if (!NT_STATUS_IS_OK(status)) {
/*
* TODO: cancel all outstanding requests on the session
*/
- file_close_user(req->sconn, req->session->compat->vuid);
-
- for (conn=req->sconn->connections; conn; conn=next_conn) {
- struct smbXsrv_tcon *tcon;
-
- next_conn = conn->next;
- tcon = conn->tcon;
-
- if (conn->vuid != req->session->compat->vuid) {
- continue;
- }
-
- set_current_service(conn, 0, True);
- close_cnum(conn, conn->vuid);
-
- /* for now tcon is NULL for SMB1 */
- TALLOC_FREE(tcon);
+ status = smbXsrv_session_logoff(req->session);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("smbd_smb2_request_process_logoff: "
+ "smbXsrv_session_logoff() failed: %s\n",
+ nt_errstr(status)));
+ /*
+ * If we hit this case, there is something completely
+ * wrong, so we better disconnect the transport connection.
+ */
+ return status;
}
- invalidate_vuid(req->sconn, req->session->compat->vuid);
- req->session->compat = NULL;
-
- req->session->status = NT_STATUS_USER_SESSION_DELETED;
-
/*
* we may need to sign the response, so we need to keep
* the session until the response is sent to the wire.