From 3b37857138aa7376077f1bf9a6756074329e2f9a Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Tue, 20 Feb 2018 16:24:45 +0100 Subject: [PATCH] use smb_get_latest_intact_client_connection --- source3/smbd/smb2_break.c | 7 ++++++- source3/smbd/smb2_server.c | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/source3/smbd/smb2_break.c b/source3/smbd/smb2_break.c index 284498503db..806eccc8deb 100644 --- a/source3/smbd/smb2_break.c +++ b/source3/smbd/smb2_break.c @@ -455,7 +455,12 @@ void send_break_message_smb2(files_struct *fsp, /* try to pick the last client */ client = fsp->conn->sconn->client; - xconn = smb_get_latest_client_connection(client); + xconn = smb_get_latest_intact_client_connection(client); + if (!xconn) { + DEBUG(1,("No valid channel available\n")); + return; + } + status = smb2srv_session_lookup_conn(xconn, fsp->vuid, diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index 507165249d6..764f4821a6f 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -3409,6 +3409,10 @@ static NTSTATUS smbd_smb2_send_break(struct smbXsrv_client *client, return NT_STATUS_INVALID_PARAMETER_MIX; } + xconn = smb_get_latest_intact_client_connection(client); + if (!xconn) + return NT_STATUS_CONNECTION_DISCONNECTED; + if (do_encryption) { DATA_BLOB encryption_key = session->global->encryption_key; @@ -3421,8 +3425,6 @@ static NTSTATUS smbd_smb2_send_break(struct smbXsrv_client *client, } } - xconn = smb_get_latest_client_connection(client); - state->queue_entry.mem_ctx = state; state->queue_entry.vector = state->vector; state->queue_entry.count = ARRAY_SIZE(state->vector); -- 2.34.1