From 6bf99b9e859141185fd39f4233d0b42329bfd764 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 10 May 2007 08:39:44 +0000 Subject: r22774: correctly initialize the smbsrv_connection when switching to SMB2 metze (This used to be commit 0fa4eb7323d95b6b8fb0c98225aebfa0b05e685a) --- source4/smb_server/smb/negprot.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source4/smb_server/smb/negprot.c') diff --git a/source4/smb_server/smb/negprot.c b/source4/smb_server/smb/negprot.c index 04bae886b6..bd6a0d63a3 100644 --- a/source4/smb_server/smb/negprot.c +++ b/source4/smb_server/smb/negprot.c @@ -436,8 +436,21 @@ static void reply_nt1(struct smbsrv_request *req, uint16_t choice) static void reply_smb2(struct smbsrv_request *req, uint16_t choice) { struct smbsrv_connection *smb_conn = req->smb_conn; + NTSTATUS status; + + talloc_free(smb_conn->sessions.idtree_vuid); + ZERO_STRUCT(smb_conn->sessions); + talloc_free(smb_conn->smb_tcons.idtree_tid); + ZERO_STRUCT(smb_conn->smb_tcons); + ZERO_STRUCT(smb_conn->signing); /* reply with a SMB2 packet */ + status = smbsrv_init_smb2_connection(smb_conn); + if (!NT_STATUS_IS_OK(status)) { + smbsrv_terminate_connection(smb_conn, nt_errstr(status)); + talloc_free(req); + return; + } packet_set_callback(smb_conn->packet, smbsrv_recv_smb2_request); smb2srv_reply_smb_negprot(req); req = NULL; -- cgit