1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s3:smbd: pass smbXsrv_connection to smb1_parse_chain()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Stefan Metzmacher 2014-06-12 08:43:26 +02:00 committed by Michael Adam
parent 7c1553fe89
commit 3a26bd1a3d
3 changed files with 10 additions and 6 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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);