diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-07-23 20:38:33 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-07-24 18:44:04 +0200 |
commit | 20e4392b255b98c22e12b5dbe1727457b419fb28 (patch) | |
tree | 73f0ea22faee331d491b20fc9c6e5dcb88c46a07 /source3 | |
parent | cc0d49063035030dff58d4a2cb9ca45f9316f173 (diff) | |
download | samba-20e4392b255b98c22e12b5dbe1727457b419fb28.tar.gz samba-20e4392b255b98c22e12b5dbe1727457b419fb28.tar.bz2 samba-20e4392b255b98c22e12b5dbe1727457b419fb28.zip |
s3:libsmb: make use of cli_state_[g|s]et_tid()
metze
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/async_smb.c | 8 | ||||
-rw-r--r-- | source3/libsmb/cliconnect.c | 7 | ||||
-rw-r--r-- | source3/libsmb/clientgen.c | 4 | ||||
-rw-r--r-- | source3/libsmb/clitrans.c | 8 |
4 files changed, 19 insertions, 8 deletions
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c index a82b0ced72..9704ea59a9 100644 --- a/source3/libsmb/async_smb.c +++ b/source3/libsmb/async_smb.c @@ -62,6 +62,7 @@ struct tevent_req *cli_smb_req_create(TALLOC_CTX *mem_ctx, uint8_t clear_flags = 0; uint16_t additional_flags2 = 0; uint16_t clear_flags2 = 0; + uint16_t tid = 0; state = talloc_zero(mem_ctx, struct cli_smb_req_state); if (state == NULL) { @@ -87,12 +88,13 @@ struct tevent_req *cli_smb_req_create(TALLOC_CTX *mem_ctx, additional_flags2 |= FLAGS2_DFS_PATHNAMES; } + tid = cli_state_get_tid(cli); state->req = smb1cli_req_create(state, ev, cli->conn, smb_command, additional_flags, clear_flags, additional_flags2, clear_flags2, cli->timeout, cli->smb1.pid, - cli->smb1.tid, + tid, cli->smb1.session, wct, vwv, iov_count, bytes_iov); if (state->req == NULL) { @@ -120,6 +122,7 @@ struct tevent_req *cli_smb_send(TALLOC_CTX *mem_ctx, uint8_t clear_flags = 0; uint16_t additional_flags2 = 0; uint16_t clear_flags2 = 0; + uint16_t tid = 0; state = talloc_zero(mem_ctx, struct cli_smb_req_state); if (state == NULL) { @@ -145,12 +148,13 @@ struct tevent_req *cli_smb_send(TALLOC_CTX *mem_ctx, additional_flags2 |= FLAGS2_DFS_PATHNAMES; } + tid = cli_state_get_tid(cli); state->req = smb1cli_req_send(state, ev, cli->conn, smb_command, additional_flags, clear_flags, additional_flags2, clear_flags2, cli->timeout, cli->smb1.pid, - cli->smb1.tid, + tid, cli->smb1.session, wct, vwv, num_bytes, bytes); if (state->req == NULL) { diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index acc3a21c74..17b5af679f 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -2469,7 +2469,7 @@ static void cli_tcon_andx_done(struct tevent_req *subreq) cli->dfsroot = ((SVAL(vwv+2, 0) & SMB_SHARE_IN_DFS) != 0); } - cli->smb1.tid = SVAL(inhdr, HDR_TID); + cli_state_set_tid(cli, SVAL(inhdr, HDR_TID)); tevent_req_done(req); } @@ -2541,7 +2541,8 @@ NTSTATUS cli_tree_connect(struct cli_state *cli, const char *share, if (!NT_STATUS_IS_OK(status)) { return status; } - cli->smb1.tid = tid; + + cli_state_set_tid(cli, tid); return NT_STATUS_OK; } @@ -2591,7 +2592,7 @@ static void cli_tdis_done(struct tevent_req *subreq) tevent_req_nterror(req, status); return; } - state->cli->smb1.tid = UINT16_MAX; + cli_state_set_tid(state->cli, UINT16_MAX); tevent_req_done(req); } diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index 88cb44da57..47cb0f30dd 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -383,7 +383,9 @@ uint16_t cli_getpid(struct cli_state *cli) bool cli_state_has_tcon(struct cli_state *cli) { - if (cli->smb1.tid == UINT16_MAX) { + uint16_t tid = cli_state_get_tid(cli); + + if (tid == UINT16_MAX) { return false; } diff --git a/source3/libsmb/clitrans.c b/source3/libsmb/clitrans.c index 5a27678310..9755d57254 100644 --- a/source3/libsmb/clitrans.c +++ b/source3/libsmb/clitrans.c @@ -61,6 +61,7 @@ struct tevent_req *cli_trans_send( uint8_t clear_flags = 0; uint16_t additional_flags2 = 0; uint16_t clear_flags2 = 0; + uint16_t tid = 0; state = talloc_zero(mem_ctx, struct cli_trans_state); if (state == NULL) { @@ -84,12 +85,13 @@ struct tevent_req *cli_trans_send( additional_flags2 |= FLAGS2_DFS_PATHNAMES; } + tid = cli_state_get_tid(cli); state->req = smb1cli_trans_send(state, ev, cli->conn, cmd, additional_flags, clear_flags, additional_flags2, clear_flags2, cli->timeout, - cli->smb1.pid, cli->smb1.tid, + cli->smb1.pid, tid, cli->smb1.session, pipe_name, fid, function, flags, setup, num_setup, max_setup, @@ -167,6 +169,7 @@ NTSTATUS cli_trans(TALLOC_CTX *mem_ctx, struct cli_state *cli, uint8_t clear_flags = 0; uint16_t additional_flags2 = 0; uint16_t clear_flags2 = 0; + uint16_t tid = 0; if (cli->case_sensitive) { clear_flags |= FLAG_CASELESS_PATHNAMES; @@ -179,12 +182,13 @@ NTSTATUS cli_trans(TALLOC_CTX *mem_ctx, struct cli_state *cli, additional_flags2 |= FLAGS2_DFS_PATHNAMES; } + tid = cli_state_get_tid(cli); status = smb1cli_trans(mem_ctx, cli->conn, trans_cmd, additional_flags, clear_flags, additional_flags2, clear_flags2, cli->timeout, - cli->smb1.pid, cli->smb1.tid, + cli->smb1.pid, tid, cli->smb1.session, pipe_name, fid, function, flags, setup, num_setup, max_setup, |