summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorLuk Claes <luk@debian.org>2012-05-10 18:37:43 +0200
committerStefan Metzmacher <metze@samba.org>2012-05-12 00:46:30 +0200
commit50d88c96bc03206b59a882669ab13f763945d41f (patch)
tree9245ad36c7f3741d18915a376e4beec294622770 /source3
parent5f4a009f4fe366ed13c1c681595ae95554643768 (diff)
downloadsamba-50d88c96bc03206b59a882669ab13f763945d41f.tar.gz
samba-50d88c96bc03206b59a882669ab13f763945d41f.tar.bz2
samba-50d88c96bc03206b59a882669ab13f763945d41f.zip
s3/libsmb: Generalise cli_state in smb2 query_directory calls
Signed-off-by: Luk Claes <luk@debian.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/smb2cli.h10
-rw-r--r--source3/libsmb/smb2cli_query_directory.c25
-rw-r--r--source3/torture/test_smb2.c12
3 files changed, 32 insertions, 15 deletions
diff --git a/source3/libsmb/smb2cli.h b/source3/libsmb/smb2cli.h
index 121ba3bede..e562945358 100644
--- a/source3/libsmb/smb2cli.h
+++ b/source3/libsmb/smb2cli.h
@@ -162,7 +162,10 @@ NTSTATUS smb2cli_write(struct cli_state *cli,
struct tevent_req *smb2cli_query_directory_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
- struct cli_state *cli,
+ struct smbXcli_conn *conn,
+ uint32_t timeout_msec,
+ struct smbXcli_session *session,
+ uint32_t tcon_id,
uint8_t level,
uint8_t flags,
uint32_t file_index,
@@ -174,7 +177,10 @@ NTSTATUS smb2cli_query_directory_recv(struct tevent_req *req,
TALLOC_CTX *mem_ctx,
uint8_t **data,
uint32_t *data_length);
-NTSTATUS smb2cli_query_directory(struct cli_state *cli,
+NTSTATUS smb2cli_query_directory(struct smbXcli_conn *conn,
+ uint32_t timeout_msec,
+ struct smbXcli_session *session,
+ uint32_t tcon_id,
uint8_t level,
uint8_t flags,
uint32_t file_index,
diff --git a/source3/libsmb/smb2cli_query_directory.c b/source3/libsmb/smb2cli_query_directory.c
index f0c857e41b..32ff82969f 100644
--- a/source3/libsmb/smb2cli_query_directory.c
+++ b/source3/libsmb/smb2cli_query_directory.c
@@ -37,7 +37,10 @@ static void smb2cli_query_directory_done(struct tevent_req *subreq);
struct tevent_req *smb2cli_query_directory_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
- struct cli_state *cli,
+ struct smbXcli_conn *conn,
+ uint32_t timeout_msec,
+ struct smbXcli_session *session,
+ uint32_t tcon_id,
uint8_t level,
uint8_t flags,
uint32_t file_index,
@@ -86,12 +89,12 @@ struct tevent_req *smb2cli_query_directory_send(TALLOC_CTX *mem_ctx,
dyn_len = sizeof(state->dyn_pad);
}
- subreq = smb2cli_req_send(state, ev, cli->conn, SMB2_OP_FIND,
+ subreq = smb2cli_req_send(state, ev, conn, SMB2_OP_FIND,
0, 0, /* flags */
- cli->timeout,
- cli->smb2.pid,
- cli->smb2.tid,
- cli->smb2.session,
+ timeout_msec,
+ 0xFEFF, /* pid */
+ tcon_id,
+ session,
state->fixed, sizeof(state->fixed),
dyn, dyn_len);
if (tevent_req_nomem(subreq, req)) {
@@ -158,7 +161,10 @@ NTSTATUS smb2cli_query_directory_recv(struct tevent_req *req,
return NT_STATUS_OK;
}
-NTSTATUS smb2cli_query_directory(struct cli_state *cli,
+NTSTATUS smb2cli_query_directory(struct smbXcli_conn *conn,
+ uint32_t timeout_msec,
+ struct smbXcli_session *session,
+ uint32_t tcon_id,
uint8_t level,
uint8_t flags,
uint32_t file_index,
@@ -175,7 +181,7 @@ NTSTATUS smb2cli_query_directory(struct cli_state *cli,
struct tevent_req *req;
NTSTATUS status = NT_STATUS_NO_MEMORY;
- if (cli_has_async_calls(cli)) {
+ if (smbXcli_conn_has_async_calls(conn)) {
/*
* Can't use sync call while an async call is in flight
*/
@@ -186,7 +192,8 @@ NTSTATUS smb2cli_query_directory(struct cli_state *cli,
if (ev == NULL) {
goto fail;
}
- req = smb2cli_query_directory_send(frame, ev, cli, level, flags,
+ req = smb2cli_query_directory_send(frame, ev, conn, timeout_msec,
+ session, tcon_id, level, flags,
file_index, fid_persistent,
fid_volatile, mask, outbuf_len);
if (req == NULL) {
diff --git a/source3/torture/test_smb2.c b/source3/torture/test_smb2.c
index a8f7cd421e..8ce0ad84e7 100644
--- a/source3/torture/test_smb2.c
+++ b/source3/torture/test_smb2.c
@@ -151,7 +151,8 @@ bool run_smb2_basic(int dummy)
}
status = smb2cli_query_directory(
- cli, 1, 0, 0, fid_persistent, fid_volatile, "*", 0xffff,
+ cli->conn, cli->timeout, cli->smb2.session, cli->smb2.tid,
+ 1, 0, 0, fid_persistent, fid_volatile, "*", 0xffff,
talloc_tos(), &dir_data, &dir_data_length);
if (!NT_STATUS_IS_OK(status)) {
@@ -1485,7 +1486,8 @@ bool run_smb2_session_reauth(int dummy)
}
status = smb2cli_query_directory(
- cli, 1, 0x3, 0, dir_persistent, dir_volatile,
+ cli->conn, cli->timeout, cli->smb2.session, cli->smb2.tid,
+ 1, 0x3, 0, dir_persistent, dir_volatile,
"session-reauth.txt", 0xffff,
talloc_tos(), &dir_data, &dir_data_length);
if (!NT_STATUS_IS_OK(status)) {
@@ -1579,7 +1581,8 @@ bool run_smb2_session_reauth(int dummy)
}
status = smb2cli_query_directory(
- cli, 1, 0x3, 0, dir_persistent, dir_volatile,
+ cli->conn, cli->timeout, cli->smb2.session, cli->smb2.tid,
+ 1, 0x3, 0, dir_persistent, dir_volatile,
"session-reauth.txt", 0xffff,
talloc_tos(), &dir_data, &dir_data_length);
if (!NT_STATUS_IS_OK(status)) {
@@ -1830,7 +1833,8 @@ bool run_smb2_session_reauth(int dummy)
}
status = smb2cli_query_directory(
- cli, 1, 0x3, 0, dir_persistent, dir_volatile,
+ cli->conn, cli->timeout, cli->smb2.session, cli->smb2.tid,
+ 1, 0x3, 0, dir_persistent, dir_volatile,
"session-reauth.txt", 0xffff,
talloc_tos(), &dir_data, &dir_data_length);
if (!NT_STATUS_IS_OK(status)) {