summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-06-12 08:43:26 +0200
committerMichael Adam <obnox@samba.org>2014-09-19 09:15:11 +0200
commit3a26bd1a3d7f0525bbed1b23a28a2a11d43973a8 (patch)
tree45d5050cb2159b9aa685fcd611e0f7d065b6691e
parent7c1553fe89ac9ba1844b8680320911dcacc0ba67 (diff)
downloadsamba-3a26bd1a3d7f0525bbed1b23a28a2a11d43973a8.tar.gz
samba-3a26bd1a3d7f0525bbed1b23a28a2a11d43973a8.tar.xz
samba-3a26bd1a3d7f0525bbed1b23a28a2a11d43973a8.zip
s3:smbd: pass smbXsrv_connection to smb1_parse_chain()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
-rw-r--r--source3/smbd/process.c10
-rw-r--r--source3/smbd/proto.h2
-rw-r--r--source3/torture/vfstest_chain.c4
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);