summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-08-05 12:48:52 +0200
committerVolker Lendecke <vl@samba.org>2010-08-05 13:57:29 +0200
commit0a224bc77b9bb59c72b9d79d9e8637837ffd878c (patch)
tree85a8f45f87cdce2cabd6ebebdbc4d23762490492 /source3
parenta13b96f04a59ec9be9e72ffab4dc6b3f9e1b4dc3 (diff)
downloadsamba-0a224bc77b9bb59c72b9d79d9e8637837ffd878c.tar.gz
samba-0a224bc77b9bb59c72b9d79d9e8637837ffd878c.tar.bz2
samba-0a224bc77b9bb59c72b9d79d9e8637837ffd878c.zip
s3: Save the received trans2 from the inbuf in cli_trans
Diffstat (limited to 'source3')
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/libsmb/clifile.c21
-rw-r--r--source3/libsmb/clifsinfo.c9
-rw-r--r--source3/libsmb/clirap.c1
-rw-r--r--source3/libsmb/clisecdesc.c1
-rw-r--r--source3/libsmb/clitrans.c11
-rw-r--r--source3/rpc_client/rpc_transport_np.c3
7 files changed, 32 insertions, 16 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 2e081aa09a..8996a2165d 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -2687,6 +2687,7 @@ struct tevent_req *cli_trans_send(
uint8_t *param, uint32_t num_param, uint32_t max_param,
uint8_t *data, uint32_t num_data, uint32_t max_data);
NTSTATUS cli_trans_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+ uint16_t *recv_flags2,
uint16_t **setup, uint8_t min_setup,
uint8_t *num_setup,
uint8_t **param, uint32_t min_param,
@@ -2700,6 +2701,7 @@ NTSTATUS cli_trans(TALLOC_CTX *mem_ctx, struct cli_state *cli,
uint16_t *setup, uint8_t num_setup, uint8_t max_setup,
uint8_t *param, uint32_t num_param, uint32_t max_param,
uint8_t *data, uint32_t num_data, uint32_t max_data,
+ uint16_t *recv_flags2,
uint16_t **rsetup, uint8_t min_rsetup, uint8_t *num_rsetup,
uint8_t **rparam, uint32_t min_rparam, uint32_t *num_rparam,
uint8_t **rdata, uint32_t min_rdata, uint32_t *num_rdata);
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 6b8230b674..28dcc0280a 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -119,7 +119,7 @@ struct link_state {
static void cli_posix_link_internal_done(struct tevent_req *subreq)
{
- NTSTATUS status = cli_trans_recv(subreq, NULL, NULL, 0, NULL,
+ NTSTATUS status = cli_trans_recv(subreq, NULL, NULL, NULL, 0, NULL,
NULL, 0, NULL, NULL, 0, NULL);
tevent_req_simple_finish_ntstatus(subreq, status);
}
@@ -836,7 +836,7 @@ struct ch_state {
static void cli_posix_chown_chmod_internal_done(struct tevent_req *subreq)
{
- NTSTATUS status = cli_trans_recv(subreq, NULL, NULL, 0, NULL,
+ NTSTATUS status = cli_trans_recv(subreq, NULL, NULL, NULL, 0, NULL,
NULL, 0, NULL, NULL, 0, NULL);
tevent_req_simple_finish_ntstatus(subreq, status);
}
@@ -1734,7 +1734,7 @@ struct doc_state {
static void cli_nt_delete_on_close_done(struct tevent_req *subreq)
{
- NTSTATUS status = cli_trans_recv(subreq, NULL, NULL, 0, NULL,
+ NTSTATUS status = cli_trans_recv(subreq, NULL, NULL, NULL, 0, NULL,
NULL, 0, NULL, NULL, 0, NULL);
tevent_req_simple_finish_ntstatus(subreq, status);
}
@@ -2344,7 +2344,7 @@ struct ftrunc_state {
static void cli_ftruncate_done(struct tevent_req *subreq)
{
- NTSTATUS status = cli_trans_recv(subreq, NULL, NULL, 0, NULL,
+ NTSTATUS status = cli_trans_recv(subreq, NULL, NULL, NULL, 0, NULL,
NULL, 0, NULL, NULL, 0, NULL);
tevent_req_simple_finish_ntstatus(subreq, status);
}
@@ -2869,7 +2869,7 @@ struct posix_lock_state {
static void cli_posix_unlock_internal_done(struct tevent_req *subreq)
{
- NTSTATUS status = cli_trans_recv(subreq, NULL, NULL, 0, NULL,
+ NTSTATUS status = cli_trans_recv(subreq, NULL, NULL, NULL, 0, NULL,
NULL, 0, NULL, NULL, 0, NULL);
tevent_req_simple_finish_ntstatus(subreq, status);
}
@@ -4517,8 +4517,8 @@ static void cli_posix_open_internal_done(struct tevent_req *subreq)
uint8_t *data;
uint32_t num_data;
- status = cli_trans_recv(subreq, state, NULL, 0, NULL, NULL, 0, NULL,
- &data, 12, &num_data);
+ status = cli_trans_recv(subreq, state, NULL, NULL, 0, NULL,
+ NULL, 0, NULL, &data, 12, &num_data);
TALLOC_FREE(subreq);
if (!NT_STATUS_IS_OK(status)) {
tevent_req_nterror(req, status);
@@ -4753,7 +4753,7 @@ struct unlink_state {
static void cli_posix_unlink_internal_done(struct tevent_req *subreq)
{
- NTSTATUS status = cli_trans_recv(subreq, NULL, NULL, 0, NULL,
+ NTSTATUS status = cli_trans_recv(subreq, NULL, NULL, NULL, 0, NULL,
NULL, 0, NULL, NULL, 0, NULL);
tevent_req_simple_finish_ntstatus(subreq, status);
}
@@ -5020,7 +5020,7 @@ static void cli_notify_done(struct tevent_req *subreq)
uint8_t *params;
uint32_t i, ofs, num_params;
- status = cli_trans_recv(subreq, talloc_tos(), NULL, 0, NULL,
+ status = cli_trans_recv(subreq, talloc_tos(), NULL, NULL, 0, NULL,
&params, 0, &num_params, NULL, 0, NULL);
TALLOC_FREE(subreq);
if (!NT_STATUS_IS_OK(status)) {
@@ -5170,7 +5170,8 @@ static void cli_qpathinfo_done(struct tevent_req *subreq)
req, struct cli_qpathinfo_state);
NTSTATUS status;
- status = cli_trans_recv(subreq, state, NULL, 0, NULL, NULL, 0, NULL,
+ status = cli_trans_recv(subreq, state, NULL, NULL, 0, NULL,
+ NULL, 0, NULL,
&state->rdata, state->min_rdata,
&state->num_rdata);
if (!NT_STATUS_IS_OK(status)) {
diff --git a/source3/libsmb/clifsinfo.c b/source3/libsmb/clifsinfo.c
index 9e4d9fa8ad..6cbf7104d4 100644
--- a/source3/libsmb/clifsinfo.c
+++ b/source3/libsmb/clifsinfo.c
@@ -74,8 +74,8 @@ static void cli_unix_extensions_version_done(struct tevent_req *subreq)
uint32_t num_data;
NTSTATUS status;
- status = cli_trans_recv(subreq, state, NULL, 0, NULL, NULL, 0, NULL,
- &data, 12, &num_data);
+ status = cli_trans_recv(subreq, state, NULL, NULL, 0, NULL,
+ NULL, 0, NULL, &data, 12, &num_data);
TALLOC_FREE(subreq);
if (!NT_STATUS_IS_OK(status)) {
tevent_req_nterror(req, status);
@@ -214,7 +214,7 @@ static void cli_set_unix_extensions_capabilities_done(
struct cli_set_unix_extensions_capabilities_state *state = tevent_req_data(
req, struct cli_set_unix_extensions_capabilities_state);
- NTSTATUS status = cli_trans_recv(subreq, NULL, NULL, 0, NULL,
+ NTSTATUS status = cli_trans_recv(subreq, NULL, NULL, NULL, 0, NULL,
NULL, 0, NULL, NULL, 0, NULL);
if (NT_STATUS_IS_OK(status)) {
state->cli->requested_posix_capabilities = IVAL(state->data, 4);
@@ -304,7 +304,7 @@ static void cli_get_fs_attr_info_done(struct tevent_req *subreq)
uint32_t num_data;
NTSTATUS status;
- status = cli_trans_recv(subreq, talloc_tos(), NULL, 0, NULL,
+ status = cli_trans_recv(subreq, talloc_tos(), NULL, NULL, 0, NULL,
NULL, 0, NULL, &data, 12, &num_data);
TALLOC_FREE(subreq);
if (!NT_STATUS_IS_OK(status)) {
@@ -376,6 +376,7 @@ NTSTATUS cli_get_fs_volume_info(struct cli_state *cli, fstring volume_name,
setup, 1, 0,
param, 2, 0,
NULL, 0, 560,
+ NULL,
NULL, 0, NULL,
NULL, 0, NULL,
&rdata, 10, &rdata_count);
diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c
index df378941db..6c4826dd8e 100644
--- a/source3/libsmb/clirap.c
+++ b/source3/libsmb/clirap.c
@@ -1171,6 +1171,7 @@ bool cli_qfileinfo(struct cli_state *cli, uint16_t fnum,
&setup, 1, 0, /* setup, length, max */
param, 4, 2, /* param, length, max */
NULL, 0, MIN(cli->max_xmit, 0xffff), /* data, length, max */
+ NULL, /* recv_flags2 */
NULL, 0, NULL, /* rsetup, length */
NULL, 0, NULL, /* rparam, length */
&rdata, 68, &data_len);
diff --git a/source3/libsmb/clisecdesc.c b/source3/libsmb/clisecdesc.c
index 1fc3da0c86..6e7beef036 100644
--- a/source3/libsmb/clisecdesc.c
+++ b/source3/libsmb/clisecdesc.c
@@ -40,6 +40,7 @@ struct security_descriptor *cli_query_secdesc(struct cli_state *cli, uint16_t fn
NULL, 0, 0, /* setup, length, max */
param, 8, 4, /* param, length, max */
NULL, 0, 0x10000, /* data, length, max */
+ NULL, /* recv_flags2 */
NULL, 0, NULL, /* rsetup, length */
NULL, 0, NULL,
&rdata, 0, &rdata_count);
diff --git a/source3/libsmb/clitrans.c b/source3/libsmb/clitrans.c
index 56580e6a6d..dd0873d824 100644
--- a/source3/libsmb/clitrans.c
+++ b/source3/libsmb/clitrans.c
@@ -720,6 +720,7 @@ struct cli_trans_state {
uint16_t *rsetup;
struct trans_recvblob rparam;
struct trans_recvblob rdata;
+ uint16_t recv_flags2;
TALLOC_CTX *secondary_request_ctx;
@@ -1191,6 +1192,7 @@ static void cli_trans_done(struct tevent_req *subreq)
if ((state->rparam.total == state->rparam.received)
&& (state->rdata.total == state->rdata.received)) {
+ state->recv_flags2 = SVAL(inbuf, smb_flg2);
TALLOC_FREE(subreq);
cli_state_seqnum_remove(state->cli, state->mid);
tevent_req_done(req);
@@ -1212,6 +1214,7 @@ static void cli_trans_done(struct tevent_req *subreq)
}
NTSTATUS cli_trans_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+ uint16_t *recv_flags2,
uint16_t **setup, uint8_t min_setup,
uint8_t *num_setup,
uint8_t **param, uint32_t min_param,
@@ -1233,6 +1236,10 @@ NTSTATUS cli_trans_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
return NT_STATUS_INVALID_NETWORK_RESPONSE;
}
+ if (recv_flags2 != NULL) {
+ *recv_flags2 = state->recv_flags2;
+ }
+
if (setup != NULL) {
*setup = talloc_move(mem_ctx, &state->rsetup);
*num_setup = state->num_rsetup;
@@ -1264,6 +1271,7 @@ NTSTATUS cli_trans(TALLOC_CTX *mem_ctx, struct cli_state *cli,
uint16_t *setup, uint8_t num_setup, uint8_t max_setup,
uint8_t *param, uint32_t num_param, uint32_t max_param,
uint8_t *data, uint32_t num_data, uint32_t max_data,
+ uint16_t *recv_flags2,
uint16_t **rsetup, uint8_t min_rsetup, uint8_t *num_rsetup,
uint8_t **rparam, uint32_t min_rparam, uint32_t *num_rparam,
uint8_t **rdata, uint32_t min_rdata, uint32_t *num_rdata)
@@ -1302,7 +1310,8 @@ NTSTATUS cli_trans(TALLOC_CTX *mem_ctx, struct cli_state *cli,
goto fail;
}
- status = cli_trans_recv(req, mem_ctx, rsetup, min_rsetup, num_rsetup,
+ status = cli_trans_recv(req, mem_ctx, recv_flags2,
+ rsetup, min_rsetup, num_rsetup,
rparam, min_rparam, num_rparam,
rdata, min_rdata, num_rdata);
fail:
diff --git a/source3/rpc_client/rpc_transport_np.c b/source3/rpc_client/rpc_transport_np.c
index e00c1f30ba..9d803aa9d4 100644
--- a/source3/rpc_client/rpc_transport_np.c
+++ b/source3/rpc_client/rpc_transport_np.c
@@ -329,7 +329,8 @@ static void rpc_np_trans_done(struct tevent_req *subreq)
req, struct rpc_np_trans_state);
NTSTATUS status;
- status = cli_trans_recv(subreq, state, NULL, 0, NULL, NULL, 0, NULL,
+ status = cli_trans_recv(subreq, state, NULL, NULL, 0, NULL,
+ NULL, 0, NULL,
&state->rdata, 0, &state->rdata_len);
TALLOC_FREE(subreq);
if (NT_STATUS_EQUAL(status, NT_STATUS_BUFFER_TOO_SMALL)) {