summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-01-27 13:39:54 +0100
committerStefan Metzmacher <metze@samba.org>2012-01-27 15:27:40 +0100
commitc543ce102890532c45ec9b293b705336f0e2c5bf (patch)
treec9037b396357d7584b97b62a97767e9c571eaa51 /libcli
parent2dd696a5dfc74a12528dd153ce5e9ba33e2e5980 (diff)
downloadsamba-c543ce102890532c45ec9b293b705336f0e2c5bf.tar.gz
samba-c543ce102890532c45ec9b293b705336f0e2c5bf.tar.bz2
samba-c543ce102890532c45ec9b293b705336f0e2c5bf.zip
libcli/smb: fix smbXcli_negprot(..., PROTOCOL_NT1, PROTOCOL_SMB2_02)
The SMB1 negprot request already consumed the SMB2 sequence '0'. This also happens for the SMB 2.02 case. metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Fri Jan 27 15:27:41 CET 2012 on sn-devel-104
Diffstat (limited to 'libcli')
-rw-r--r--libcli/smb/smbXcli_base.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index ba40ef7bf1..06fcb34a31 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -3838,10 +3838,8 @@ static void smbXcli_negprot_smb2_done(struct tevent_req *subreq)
/*
* send a SMB2 negprot, in order to negotiate
- * the SMB2 dialect. This needs to use the
- * message id 1.
+ * the SMB2 dialect.
*/
- state->conn->smb2.mid = 1;
subreq = smbXcli_negprot_smb2_subreq(state);
if (tevent_req_nomem(subreq, req)) {
return;
@@ -3921,6 +3919,11 @@ static NTSTATUS smbXcli_negprot_dispatch_incoming(struct smbXcli_conn *conn,
substate->smb1.recv_iov = NULL;
}
+ /*
+ * we got an SMB2 answer, which consumed sequence number 0
+ * so we need to use 1 as the next one
+ */
+ conn->smb2.mid = 1;
tevent_req_set_callback(subreq, smbXcli_negprot_smb2_done, req);
conn->dispatch_incoming = smb2cli_conn_dispatch_incoming;
return smb2cli_conn_dispatch_incoming(conn, tmp_mem, inbuf);