diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-07-23 21:34:58 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-07-24 21:22:44 +0200 |
commit | b9100a7ac443159716398aaadfab34af64d8858b (patch) | |
tree | 7148b0a41ec094b19e27b2ee85b18cded4f88254 /libcli | |
parent | 29dc01b1755081b1b7a9b38ad4f7e6fdaa795bf9 (diff) | |
download | samba-b9100a7ac443159716398aaadfab34af64d8858b.tar.gz samba-b9100a7ac443159716398aaadfab34af64d8858b.tar.bz2 samba-b9100a7ac443159716398aaadfab34af64d8858b.zip |
libcli/smb: pass down smbXcli_tcon to smb1cli_req_create/send() and smb1cli_trans*
metze
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jul 24 21:22:44 CEST 2012 on sn-devel-104
Diffstat (limited to 'libcli')
-rw-r--r-- | libcli/smb/smb1cli_trans.c | 21 | ||||
-rw-r--r-- | libcli/smb/smbXcli_base.c | 18 | ||||
-rw-r--r-- | libcli/smb/smbXcli_base.h | 10 |
3 files changed, 31 insertions, 18 deletions
diff --git a/libcli/smb/smb1cli_trans.c b/libcli/smb/smb1cli_trans.c index ca0fdc157d..cc4f7d3b91 100644 --- a/libcli/smb/smb1cli_trans.c +++ b/libcli/smb/smb1cli_trans.c @@ -39,7 +39,7 @@ struct smb1cli_trans_state { uint32_t timeout_msec; uint16_t mid; uint32_t pid; - uint16_t tid; + struct smbXcli_tcon *tcon; struct smbXcli_session *session; const char *pipe_name; uint8_t *pipe_name_conv; @@ -415,7 +415,8 @@ struct tevent_req *smb1cli_trans_send( uint8_t additional_flags, uint8_t clear_flags, uint16_t additional_flags2, uint16_t clear_flags2, uint32_t timeout_msec, - uint32_t pid, uint16_t tid, + uint32_t pid, + struct smbXcli_tcon *tcon, struct smbXcli_session *session, const char *pipe_name, uint16_t fid, uint16_t function, int flags, uint16_t *setup, uint8_t num_setup, uint8_t max_setup, @@ -470,7 +471,7 @@ struct tevent_req *smb1cli_trans_send( state->num_rsetup = 0; state->rsetup = NULL; state->pid = pid; - state->tid = tid; + state->tcon = tcon; state->session = session; ZERO_STRUCT(state->rparam); ZERO_STRUCT(state->rdata); @@ -514,7 +515,8 @@ struct tevent_req *smb1cli_trans_send( state->additional_flags2, state->clear_flags2, state->timeout_msec, - state->pid, state->tid, + state->pid, + state->tcon, state->session, wct, state->vwv, iov_count, state->iov); @@ -646,7 +648,8 @@ static void smb1cli_trans_done(struct tevent_req *subreq) state->additional_flags2, state->clear_flags2, state->timeout_msec, - state->pid, state->tid, + state->pid, + state->tcon, state->session, wct, state->vwv, iov_count, state->iov); @@ -753,7 +756,8 @@ static void smb1cli_trans_done2(struct tevent_req *subreq2) state->additional_flags2, state->clear_flags2, state->timeout_msec, - state->pid, state->tid, + state->pid, + state->tcon, state->session, wct, state->vwv, iov_count, state->iov); @@ -844,7 +848,8 @@ NTSTATUS smb1cli_trans(TALLOC_CTX *mem_ctx, struct smbXcli_conn *conn, uint8_t additional_flags, uint8_t clear_flags, uint16_t additional_flags2, uint16_t clear_flags2, uint32_t timeout_msec, - uint32_t pid, uint16_t tid, + uint32_t pid, + struct smbXcli_tcon *tcon, struct smbXcli_session *session, const char *pipe_name, uint16_t fid, uint16_t function, int flags, @@ -879,7 +884,7 @@ NTSTATUS smb1cli_trans(TALLOC_CTX *mem_ctx, struct smbXcli_conn *conn, additional_flags, clear_flags, additional_flags2, clear_flags2, timeout_msec, - pid, tid, session, + pid, tcon, session, pipe_name, fid, function, flags, setup, num_setup, max_setup, param, num_param, max_param, diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c index e9592e78a2..037c0dd8a3 100644 --- a/libcli/smb/smbXcli_base.c +++ b/libcli/smb/smbXcli_base.c @@ -174,6 +174,7 @@ struct smbXcli_req_state { struct tevent_context *ev; struct smbXcli_conn *conn; struct smbXcli_session *session; /* maybe NULL */ + struct smbXcli_tcon *tcon; /* maybe NULL */ uint8_t length_hdr[4]; @@ -1114,7 +1115,6 @@ static bool smb1cli_req_cancel(struct tevent_req *req) uint8_t flags; uint16_t flags2; uint32_t pid; - uint16_t tid; uint16_t mid; struct tevent_req *subreq; NTSTATUS status; @@ -1123,7 +1123,6 @@ static bool smb1cli_req_cancel(struct tevent_req *req) flags2 = SVAL(state->smb1.hdr, HDR_FLG2); pid = SVAL(state->smb1.hdr, HDR_PID); pid |= SVAL(state->smb1.hdr, HDR_PIDHIGH)<<16; - tid = SVAL(state->smb1.hdr, HDR_TID); mid = SVAL(state->smb1.hdr, HDR_MID); subreq = smb1cli_req_create(state, state->ev, @@ -1132,7 +1131,8 @@ static bool smb1cli_req_cancel(struct tevent_req *req) flags, 0, flags2, 0, 0, /* timeout */ - pid, tid, + pid, + state->tcon, state->session, 0, NULL, /* vwv */ 0, NULL); /* bytes */ @@ -1169,7 +1169,7 @@ struct tevent_req *smb1cli_req_create(TALLOC_CTX *mem_ctx, uint16_t clear_flags2, uint32_t timeout_msec, uint32_t pid, - uint16_t tid, + struct smbXcli_tcon *tcon, struct smbXcli_session *session, uint8_t wct, uint16_t *vwv, int iov_count, @@ -1180,6 +1180,7 @@ struct tevent_req *smb1cli_req_create(TALLOC_CTX *mem_ctx, uint8_t flags = 0; uint16_t flags2 = 0; uint16_t uid = 0; + uint16_t tid = 0; if (iov_count > MAX_SMB_IOV) { /* @@ -1196,11 +1197,16 @@ struct tevent_req *smb1cli_req_create(TALLOC_CTX *mem_ctx, state->ev = ev; state->conn = conn; state->session = session; + state->tcon = tcon; if (session) { uid = session->smb1.session_id; } + if (tcon) { + tid = tcon->smb1.tcon_id; + } + state->smb1.recv_cmd = 0xFF; state->smb1.recv_status = NT_STATUS_INTERNAL_ERROR; state->smb1.recv_iov = talloc_zero_array(state, struct iovec, 3); @@ -1443,7 +1449,7 @@ struct tevent_req *smb1cli_req_send(TALLOC_CTX *mem_ctx, uint16_t clear_flags2, uint32_t timeout_msec, uint32_t pid, - uint16_t tid, + struct smbXcli_tcon *tcon, struct smbXcli_session *session, uint8_t wct, uint16_t *vwv, uint32_t num_bytes, @@ -1460,7 +1466,7 @@ struct tevent_req *smb1cli_req_send(TALLOC_CTX *mem_ctx, additional_flags, clear_flags, additional_flags2, clear_flags2, timeout_msec, - pid, tid, session, + pid, tcon, session, wct, vwv, 1, &iov); if (req == NULL) { return NULL; diff --git a/libcli/smb/smbXcli_base.h b/libcli/smb/smbXcli_base.h index 9f4c0bc340..a105c8278b 100644 --- a/libcli/smb/smbXcli_base.h +++ b/libcli/smb/smbXcli_base.h @@ -110,7 +110,7 @@ struct tevent_req *smb1cli_req_create(TALLOC_CTX *mem_ctx, uint16_t clear_flags2, uint32_t timeout_msec, uint32_t pid, - uint16_t tid, + struct smbXcli_tcon *tcon, struct smbXcli_session *session, uint8_t wct, uint16_t *vwv, int iov_count, @@ -127,7 +127,7 @@ struct tevent_req *smb1cli_req_send(TALLOC_CTX *mem_ctx, uint16_t clear_flags2, uint32_t timeout_msec, uint32_t pid, - uint16_t tid, + struct smbXcli_tcon *tcon, struct smbXcli_session *session, uint8_t wct, uint16_t *vwv, uint32_t num_bytes, @@ -152,7 +152,8 @@ struct tevent_req *smb1cli_trans_send( uint8_t additional_flags, uint8_t clear_flags, uint16_t additional_flags2, uint16_t clear_flags2, uint32_t timeout_msec, - uint32_t pid, uint16_t tid, + uint32_t pid, + struct smbXcli_tcon *tcon, struct smbXcli_session *session, const char *pipe_name, uint16_t fid, uint16_t function, int flags, uint16_t *setup, uint8_t num_setup, uint8_t max_setup, @@ -171,7 +172,8 @@ NTSTATUS smb1cli_trans(TALLOC_CTX *mem_ctx, struct smbXcli_conn *conn, uint8_t additional_flags, uint8_t clear_flags, uint16_t additional_flags2, uint16_t clear_flags2, uint32_t timeout_msec, - uint32_t pid, uint16_t tid, + uint32_t pid, + struct smbXcli_tcon *tcon, struct smbXcli_session *session, const char *pipe_name, uint16_t fid, uint16_t function, int flags, |