summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-10-31 15:23:00 +0100
committerStefan Metzmacher <metze@samba.org>2011-10-31 19:39:04 +0100
commit09d3df6e7e6aef03a306413e74ecd127215e1921 (patch)
tree0edb1456d032147da65ac4b0a350852195673cbb /source4
parent95ca06410310589ef2ccf95f25b089dae756b1d0 (diff)
downloadsamba-09d3df6e7e6aef03a306413e74ecd127215e1921.tar.gz
samba-09d3df6e7e6aef03a306413e74ecd127215e1921.tar.bz2
samba-09d3df6e7e6aef03a306413e74ecd127215e1921.zip
s4:smb_server/smb2: correctly implement related compound requests
We need to remember the session id and tree id. metze
Diffstat (limited to 'source4')
-rw-r--r--source4/smb_server/smb2/receive.c13
-rw-r--r--source4/smb_server/smb2/smb2_server.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/source4/smb_server/smb2/receive.c b/source4/smb_server/smb2/receive.c
index 7463712cd4..0ebf8f31a1 100644
--- a/source4/smb_server/smb2/receive.c
+++ b/source4/smb_server/smb2/receive.c
@@ -69,6 +69,9 @@ struct smb2srv_request *smb2srv_init_request(struct smbsrv_connection *smb_conn)
req->smb_conn = smb_conn;
+ req->chained_session_id = UINT64_MAX;
+ req->chained_tree_id = UINT32_MAX;
+
talloc_set_destructor(req, smb2srv_request_destructor);
return req;
@@ -233,6 +236,8 @@ static void smb2srv_chain_reply(struct smb2srv_request *p_req)
sizeof(req->_chained_file_handle));
req->chained_file_handle = req->_chained_file_handle;
}
+ req->chained_session_id = p_req->chained_session_id;
+ req->chained_tree_id = p_req->chained_tree_id;
req->chain_status = p_req->chain_status;
}
@@ -342,9 +347,17 @@ static NTSTATUS smb2srv_reply(struct smb2srv_request *req)
req->smb_conn->highest_smb2_seqnum = req->seqnum;
}
+ if (flags & SMB2_HDR_FLAG_CHAINED) {
+ uid = req->chained_session_id;
+ tid = req->chained_tree_id;
+ }
+
req->session = smbsrv_session_find(req->smb_conn, uid, req->request_time);
req->tcon = smbsrv_smb2_tcon_find(req->session, tid, req->request_time);
+ req->chained_session_id = uid;
+ req->chained_tree_id = tid;
+
errno = 0;
/* supporting signing is mandatory in SMB2, and is per-packet. So we
diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h
index 7fb09f6873..5fe12feae0 100644
--- a/source4/smb_server/smb2/smb2_server.h
+++ b/source4/smb_server/smb2/smb2_server.h
@@ -64,6 +64,8 @@ struct smb2srv_request {
/* chained file handle */
uint8_t _chained_file_handle[16];
uint8_t *chained_file_handle;
+ uint64_t chained_session_id;
+ uint32_t chained_tree_id;
bool is_signed;