summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-05-11 00:53:41 +0200
committerGünther Deschner <gd@samba.org>2010-05-11 00:58:56 +0200
commitfc6a22983b695e50f5da19000031be64764b32b7 (patch)
treef7f1c7a8400b15a534f2202c13757c68b9efb14e
parent56421886de87aa32ba6ea2badbc2d40b2ca8011d (diff)
downloadsamba-fc6a22983b695e50f5da19000031be64764b32b7.tar.gz
samba-fc6a22983b695e50f5da19000031be64764b32b7.tar.bz2
samba-fc6a22983b695e50f5da19000031be64764b32b7.zip
s4-smbtorture: correctly fill in trans.in.data in rap_cli_do_call().
Guenther
-rw-r--r--source4/torture/rap/rap.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/source4/torture/rap/rap.c b/source4/torture/rap/rap.c
index c116dde493..c056149347 100644
--- a/source4/torture/rap/rap.c
+++ b/source4/torture/rap/rap.c
@@ -148,7 +148,6 @@ static void rap_cli_push_sendbuf(struct rap_call *call, int len)
rap_cli_push_paramdesc(call, 's');
rap_cli_push_paramdesc(call, 'T');
ndr_push_uint16(call->ndr_push_param, NDR_SCALARS, len);
- call->rcv_datalen = len;
}
static void rap_cli_push_param(struct rap_call *call, uint16_t val)
@@ -224,7 +223,9 @@ static NTSTATUS rap_cli_do_call(struct smbcli_tree *tree,
{
NTSTATUS result;
DATA_BLOB param_blob;
+ DATA_BLOB data_blob;
struct ndr_push *params;
+ struct ndr_push *data;
struct smb_trans2 trans;
params = ndr_push_init_ctx(call, iconv_convenience);
@@ -234,6 +235,13 @@ static NTSTATUS rap_cli_do_call(struct smbcli_tree *tree,
params->flags = RAPNDR_FLAGS;
+ data = ndr_push_init_ctx(call, iconv_convenience);
+
+ if (data == NULL)
+ return NT_STATUS_NO_MEMORY;
+
+ data->flags = RAPNDR_FLAGS;
+
trans.in.max_param = call->rcv_paramlen;
trans.in.max_data = call->rcv_datalen;
trans.in.max_setup = 0;
@@ -253,11 +261,15 @@ static NTSTATUS rap_cli_do_call(struct smbcli_tree *tree,
NDR_RETURN(ndr_push_bytes(params, param_blob.data,
param_blob.length));
+ data_blob = ndr_push_blob(call->ndr_push_data);
+ NDR_RETURN(ndr_push_bytes(data, data_blob.data,
+ data_blob.length));
+
if (call->auxdatadesc)
NDR_RETURN(ndr_push_string(params, NDR_SCALARS, call->auxdatadesc));
trans.in.params = ndr_push_blob(params);
- trans.in.data = data_blob(NULL, 0);
+ trans.in.data = ndr_push_blob(data);
result = smb_raw_trans(tree, call, &trans);