summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-05-10 08:39:44 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:52:17 -0500
commit6bf99b9e859141185fd39f4233d0b42329bfd764 (patch)
tree22885dd06e2ba444987c7bc42b7aa1f5efd2256d /source4
parentcf4d161f15fd6c81764a1ae13d1f6211a94020c5 (diff)
downloadsamba-6bf99b9e859141185fd39f4233d0b42329bfd764.tar.gz
samba-6bf99b9e859141185fd39f4233d0b42329bfd764.tar.bz2
samba-6bf99b9e859141185fd39f4233d0b42329bfd764.zip
r22774: correctly initialize the smbsrv_connection when switching to SMB2
metze (This used to be commit 0fa4eb7323d95b6b8fb0c98225aebfa0b05e685a)
Diffstat (limited to 'source4')
-rw-r--r--source4/smb_server/smb/negprot.c13
1 files changed, 13 insertions, 0 deletions
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;