summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-06-09 11:57:55 +0200
committerJeremy Allison <jra@samba.org>2011-06-10 19:27:05 +0200
commit5d06b2197b5fd95aaf0394d1bdba957bac6c3570 (patch)
treed233f7dda507da35605a8163ab666cd127febe1e
parent1dd24ac06a7472f53b06bc0aaa54cb22c8da0f78 (diff)
downloadsamba-5d06b2197b5fd95aaf0394d1bdba957bac6c3570.tar.gz
samba-5d06b2197b5fd95aaf0394d1bdba957bac6c3570.tar.bz2
samba-5d06b2197b5fd95aaf0394d1bdba957bac6c3570.zip
s3:libsmb/clitrans: correctly transfer the seqnum between secondary and primary requests
This is needed to implement SMB signing correct. metze
-rw-r--r--source3/libsmb/clitrans.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source3/libsmb/clitrans.c b/source3/libsmb/clitrans.c
index e23598ccbb..dd8063bf1e 100644
--- a/source3/libsmb/clitrans.c
+++ b/source3/libsmb/clitrans.c
@@ -32,7 +32,6 @@ struct cli_trans_state {
struct event_context *ev;
uint8_t cmd;
uint16_t mid;
- uint32_t seqnum;
const char *pipe_name;
uint8_t *pipe_name_conv;
size_t pipe_name_conv_len;
@@ -65,7 +64,6 @@ static void cli_trans_cleanup_primary(struct cli_trans_state *state)
if (state->primary_subreq) {
cli_smb_req_set_mid(state->primary_subreq, 0);
cli_smb_req_unset_pending(state->primary_subreq);
- cli_state_seqnum_remove(state->cli, state->mid);
TALLOC_FREE(state->primary_subreq);
}
}
@@ -475,7 +473,6 @@ struct tevent_req *cli_trans_send(
*/
state->mid = cli_smb_req_mid(subreq);
cli_smb_req_set_mid(subreq, state->mid);
- cli_state_seqnum_persistent(cli, state->mid);
state->primary_subreq = subreq;
talloc_set_destructor(state, cli_trans_state_destructor);
@@ -605,6 +602,14 @@ static void cli_trans_done2(struct tevent_req *subreq2)
NTSTATUS status;
bool sent_all;
uint8_t wct;
+ uint32_t seqnum;
+
+ /*
+ * First backup the seqnum of the secondary request
+ * and attach it to the primary request.
+ */
+ seqnum = cli_smb_req_seqnum(subreq2);
+ cli_smb_req_set_seqnum(state->primary_subreq, seqnum);
status = cli_smb_recv(subreq2, state, NULL, 0, &wct, NULL,
NULL, NULL);