From 7d8f3cdbfc741aa680f23018a434ae9409b69ef0 Mon Sep 17 00:00:00 2001 From: Sam Liddicott Date: Fri, 5 Dec 2008 09:04:55 +0000 Subject: Let ntvfs request transport close via ntvfs_request state [I can't swear that this covers all the smb2 cases, there are some reply functions that I can't trace properly] Add NTVFS_ASYNC_STATE_CLOSE bit to ntvfs_request->async_states->state so that the ntvfs layer can signify that the client transport should be closed, most useful for proxy servies, and most likely due to a forwarding transport having been closed. Signed-off-by: Sam Liddicott Signed-off-by: Stefan Metzmacher --- source4/smb_server/smb2/smb2_server.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source4/smb_server/smb2') diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h index 431add4ed9..ba3021a3a9 100644 --- a/source4/smb_server/smb2/smb2_server.h +++ b/source4/smb_server/smb2/smb2_server.h @@ -153,6 +153,11 @@ struct smbsrv_request; /* check req->ntvfs->async_states->status and if not OK then send an error reply */ #define SMB2SRV_CHECK_ASYNC_STATUS_ERR_SIMPLE do { \ req = talloc_get_type(ntvfs->async_states->private_data, struct smb2srv_request); \ + if (ntvfs->async_states->state & NTVFS_ASYNC_STATE_CLOSE || NT_STATUS_EQUAL(ntvfs->async_states->status, NT_STATUS_NET_WRITE_FAULT)) { \ + smbsrv_terminate_connection(req->smb_conn, get_friendly_nt_error_msg (ntvfs->async_states->status)); \ + talloc_free(req); \ + return; \ + } \ req->status = ntvfs->async_states->status; \ if (NT_STATUS_IS_ERR(ntvfs->async_states->status)) { \ smb2srv_send_error(req, ntvfs->async_states->status); \ @@ -165,6 +170,11 @@ struct smbsrv_request; } while (0) #define SMB2SRV_CHECK_ASYNC_STATUS_SIMPLE do { \ req = talloc_get_type(ntvfs->async_states->private_data, struct smb2srv_request); \ + if (ntvfs->async_states->state & NTVFS_ASYNC_STATE_CLOSE || NT_STATUS_EQUAL(ntvfs->async_states->status, NT_STATUS_NET_WRITE_FAULT)) { \ + smbsrv_terminate_connection(req->smb_conn, get_friendly_nt_error_msg (ntvfs->async_states->status)); \ + talloc_free(req); \ + return; \ + } \ req->status = ntvfs->async_states->status; \ if (!NT_STATUS_IS_OK(ntvfs->async_states->status)) { \ smb2srv_send_error(req, ntvfs->async_states->status); \ -- cgit