From 3a26bd1a3d7f0525bbed1b23a28a2a11d43973a8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 12 Jun 2014 08:43:26 +0200 Subject: s3:smbd: pass smbXsrv_connection to smb1_parse_chain() Signed-off-by: Stefan Metzmacher Reviewed-by: Michael Adam --- source3/smbd/process.c | 10 +++++++--- source3/smbd/proto.h | 2 +- source3/torture/vfstest_chain.c | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 6ba3906487..63a902aec6 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -1704,7 +1704,7 @@ static void construct_reply_chain(struct smbd_server_connection *sconn, unsigned num_reqs; bool ok; - ok = smb1_parse_chain(talloc_tos(), (uint8_t *)inbuf, sconn, encrypted, + ok = smb1_parse_chain(talloc_tos(), (uint8_t *)inbuf, xconn, encrypted, seqnum, &reqs, &num_reqs); if (!ok) { char errbuf[smb_size]; @@ -2397,14 +2397,18 @@ static bool smb1_parse_chain_cb(uint8_t cmd, } bool smb1_parse_chain(TALLOC_CTX *mem_ctx, const uint8_t *buf, - struct smbd_server_connection *sconn, + struct smbXsrv_connection *xconn, bool encrypted, uint32_t seqnum, struct smb_request ***reqs, unsigned *num_reqs) { - struct smbXsrv_connection *xconn = sconn->conn; + struct smbd_server_connection *sconn = NULL; struct smb1_parse_chain_state state; unsigned i; + if (xconn != NULL) { + sconn = xconn->sconn; + } + state.mem_ctx = mem_ctx; state.buf = buf; state.sconn = sconn; diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index a625f78d20..f35bc61a7d 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -778,7 +778,7 @@ bool smb1_walk_chain(const uint8_t *buf, void *private_data); unsigned smb1_chain_length(const uint8_t *buf); bool smb1_parse_chain(TALLOC_CTX *mem_ctx, const uint8_t *buf, - struct smbd_server_connection *sconn, + struct smbXsrv_connection *xconn, bool encrypted, uint32_t seqnum, struct smb_request ***reqs, unsigned *num_reqs); bool req_is_in_chain(const struct smb_request *req); diff --git a/source3/torture/vfstest_chain.c b/source3/torture/vfstest_chain.c index 11c643b91a..174117b708 100644 --- a/source3/torture/vfstest_chain.c +++ b/source3/torture/vfstest_chain.c @@ -329,12 +329,12 @@ NTSTATUS cmd_test_chain(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, ret &= (chain_length == 0); ret &= smb1_parse_chain(talloc_tos(), chain1_data, - vfs->conn->sconn, false, 0, + NULL, false, 0, &requests, &chain_length); ret &= (chain_length == 3); ret &= smb1_parse_chain(talloc_tos(), chain2_data, - vfs->conn->sconn, false, 0, + NULL, false, 0, &requests, &chain_length); ret &= (chain_length == 2); -- cgit