use smb_get_latest_intact_client_connection
authorGünther Deschner <gd@samba.org>
Tue, 20 Feb 2018 15:24:45 +0000 (16:24 +0100)
committerSachin Prabhu <sprabhu@redhat.com>
Tue, 17 Jul 2018 20:46:19 +0000 (21:46 +0100)
source3/smbd/smb2_break.c
source3/smbd/smb2_server.c

index 284498503db25b0534e2966b1720ad19a80cf50f..806eccc8debf3f712708aec0a21a208142f22e6d 100644 (file)
@@ -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,
index 507165249d67bd6700e6d8505a50f80486e2f60a..764f4821a6fa8cfeca2bcf1c9a3399c683d160e1 100644 (file)
@@ -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);