summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-07-23 22:32:49 +0200
committerStefan Metzmacher <metze@samba.org>2012-07-24 22:20:06 +0200
commit6dc701c958557df6df3cbb7481025b56a4e7eef2 (patch)
tree7969d3c3800ae0a87ee9a8b7115153b08297f262
parent6612c831a3eb62da7766152e597168b9cec9b8fc (diff)
downloadsamba-6dc701c958557df6df3cbb7481025b56a4e7eef2.tar.gz
samba-6dc701c958557df6df3cbb7481025b56a4e7eef2.tar.bz2
samba-6dc701c958557df6df3cbb7481025b56a4e7eef2.zip
libcli/smb: pass smbXcli_tcon to smb2cli_set_info*()
metze
-rw-r--r--libcli/smb/smb2cli_set_info.c11
-rw-r--r--libcli/smb/smbXcli_base.h20
-rw-r--r--source3/torture/test_smb2.c4
3 files changed, 20 insertions, 15 deletions
diff --git a/libcli/smb/smb2cli_set_info.c b/libcli/smb/smb2cli_set_info.c
index 10da7b1bee..e33ba8367d 100644
--- a/libcli/smb/smb2cli_set_info.c
+++ b/libcli/smb/smb2cli_set_info.c
@@ -35,7 +35,7 @@ struct tevent_req *smb2cli_set_info_send(TALLOC_CTX *mem_ctx,
struct smbXcli_conn *conn,
uint32_t timeout_msec,
struct smbXcli_session *session,
- uint32_t tcon_id,
+ struct smbXcli_tcon *tcon,
uint8_t in_info_type,
uint8_t in_file_info_class,
const DATA_BLOB *in_input_buffer,
@@ -50,6 +50,7 @@ struct tevent_req *smb2cli_set_info_send(TALLOC_CTX *mem_ctx,
size_t dyn_len;
uint16_t input_buffer_offset = 0;
uint32_t input_buffer_length = 0;
+ uint32_t tcon_id = 0;
req = tevent_req_create(mem_ctx, &state,
struct smb2cli_set_info_state);
@@ -82,6 +83,10 @@ struct tevent_req *smb2cli_set_info_send(TALLOC_CTX *mem_ctx,
dyn_len = sizeof(state->dyn_pad);
}
+ if (tcon) {
+ tcon_id = smb2cli_tcon_current_id(tcon);
+ }
+
subreq = smb2cli_req_send(state, ev, conn, SMB2_OP_SETINFO,
0, 0, /* flags */
timeout_msec,
@@ -135,7 +140,7 @@ NTSTATUS smb2cli_set_info_recv(struct tevent_req *req)
NTSTATUS smb2cli_set_info(struct smbXcli_conn *conn,
uint32_t timeout_msec,
struct smbXcli_session *session,
- uint32_t tcon_id,
+ struct smbXcli_tcon *tcon,
uint8_t in_info_type,
uint8_t in_file_info_class,
const DATA_BLOB *in_input_buffer,
@@ -161,7 +166,7 @@ NTSTATUS smb2cli_set_info(struct smbXcli_conn *conn,
}
req = smb2cli_set_info_send(frame, ev,
conn, timeout_msec,
- session, tcon_id,
+ session, tcon,
in_info_type,
in_file_info_class,
in_input_buffer,
diff --git a/libcli/smb/smbXcli_base.h b/libcli/smb/smbXcli_base.h
index 3092b732aa..67ffe1d746 100644
--- a/libcli/smb/smbXcli_base.h
+++ b/libcli/smb/smbXcli_base.h
@@ -444,7 +444,7 @@ struct tevent_req *smb2cli_set_info_send(TALLOC_CTX *mem_ctx,
struct smbXcli_conn *conn,
uint32_t timeout_msec,
struct smbXcli_session *session,
- uint32_t tcon_id,
+ struct smbXcli_tcon *tcon,
uint8_t in_info_type,
uint8_t in_file_info_class,
const DATA_BLOB *in_input_buffer,
@@ -453,15 +453,15 @@ struct tevent_req *smb2cli_set_info_send(TALLOC_CTX *mem_ctx,
uint64_t in_fid_volatile);
NTSTATUS smb2cli_set_info_recv(struct tevent_req *req);
NTSTATUS smb2cli_set_info(struct smbXcli_conn *conn,
- uint32_t timeout_msec,
- struct smbXcli_session *session,
- uint32_t tcon_id,
- uint8_t in_info_type,
- uint8_t in_file_info_class,
- const DATA_BLOB *in_input_buffer,
- uint32_t in_additional_info,
- uint64_t in_fid_persistent,
- uint64_t in_fid_volatile);
+ uint32_t timeout_msec,
+ struct smbXcli_session *session,
+ struct smbXcli_tcon *tcon,
+ uint8_t in_info_type,
+ uint8_t in_file_info_class,
+ const DATA_BLOB *in_input_buffer,
+ uint32_t in_additional_info,
+ uint64_t in_fid_persistent,
+ uint64_t in_fid_volatile);
struct tevent_req *smb2cli_query_info_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
diff --git a/source3/torture/test_smb2.c b/source3/torture/test_smb2.c
index a511f18647..a487beafb3 100644
--- a/source3/torture/test_smb2.c
+++ b/source3/torture/test_smb2.c
@@ -1670,7 +1670,7 @@ bool run_smb2_session_reauth(int dummy)
status = smb2cli_set_info(cli->conn,
cli->timeout,
cli->smb2.session,
- cli->smb2.tid,
+ cli->smb2.tcon,
SMB2_GETINFO_FILE,
in_file_info_class,
&in_input_buffer,
@@ -1807,7 +1807,7 @@ bool run_smb2_session_reauth(int dummy)
status = smb2cli_set_info(cli->conn,
cli->timeout,
cli->smb2.session,
- cli->smb2.tid,
+ cli->smb2.tcon,
SMB2_GETINFO_FILE,
in_file_info_class,
&in_input_buffer,