summaryrefslogtreecommitdiffstats
path: root/source3/smbd/process.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-02-17 12:01:12 +0100
committerStefan Metzmacher <metze@samba.org>2014-02-21 11:48:12 +0100
commit52ccb40d595fc80bfa53b0b9cd75ffb902369681 (patch)
treef2cd180bc20262f1d7a76652720d9325b9ccff31 /source3/smbd/process.c
parent58c71bee40bb91868fc69d8f7fa640db0e33efae (diff)
downloadsamba-52ccb40d595fc80bfa53b0b9cd75ffb902369681.tar.gz
samba-52ccb40d595fc80bfa53b0b9cd75ffb902369681.tar.xz
samba-52ccb40d595fc80bfa53b0b9cd75ffb902369681.zip
s3:smbd: maintain smbd_server_connection->status
If this isn't NT_STATUS_OK, we skip any io on the socket. This avoids possible problems during shutdown. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3/smbd/process.c')
-rw-r--r--source3/smbd/process.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index f5ca2f9594..65d005df31 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -152,6 +152,13 @@ bool srv_send_smb(struct smbd_server_connection *sconn, char *buffer,
ssize_t ret;
char *buf_out = buffer;
+ if (!NT_STATUS_IS_OK(sconn->status)) {
+ /*
+ * we're not supposed to do any io
+ */
+ return true;
+ }
+
smbd_lock_socket(sconn);
if (do_signing) {
@@ -2445,6 +2452,15 @@ static void smbd_server_connection_handler(struct tevent_context *ev,
struct smbd_server_connection *conn = talloc_get_type(private_data,
struct smbd_server_connection);
+ if (!NT_STATUS_IS_OK(conn->status)) {
+ /*
+ * we're not supposed to do any io
+ */
+ TEVENT_FD_NOT_READABLE(conn->smb1.fde);
+ TEVENT_FD_NOT_WRITEABLE(conn->smb1.fde);
+ return;
+ }
+
if (flags & TEVENT_FD_WRITE) {
smbd_server_connection_write_handler(conn);
return;
@@ -2463,6 +2479,15 @@ static void smbd_server_echo_handler(struct tevent_context *ev,
struct smbd_server_connection *conn = talloc_get_type(private_data,
struct smbd_server_connection);
+ if (!NT_STATUS_IS_OK(conn->status)) {
+ /*
+ * we're not supposed to do any io
+ */
+ TEVENT_FD_NOT_READABLE(conn->smb1.echo_handler.trusted_fde);
+ TEVENT_FD_NOT_WRITEABLE(conn->smb1.echo_handler.trusted_fde);
+ return;
+ }
+
if (flags & TEVENT_FD_WRITE) {
smbd_server_connection_write_handler(conn);
return;