{
NTSTATUS status;
DATA_BLOB outbody;
- struct connection_struct *compat_conn = req->tcon->compat;
status = smbd_smb2_request_verify_sizes(req, 0x04);
if (!NT_STATUS_IS_OK(status)) {
/*
* TODO: cancel all outstanding requests on the tcon
- * and delete all file handles.
*/
- set_current_service(compat_conn, 0, true);
- close_cnum(compat_conn, compat_conn->vuid);
- req->tcon->compat = NULL;
+ status = smbXsrv_tcon_disconnect(req->tcon);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("smbd_smb2_request_process_tdis: "
+ "smbXsrv_tcon_disconnect() 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;
+ }
+
TALLOC_FREE(req->tcon);
outbody = data_blob_talloc(req->out.vector, NULL, 0x04);