diff options
author | Volker Lendecke <vl@samba.org> | 2011-01-16 13:12:16 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2011-01-17 08:03:42 +0100 |
commit | cba5a26734686deeed4785eabd87d7608b3d90f4 (patch) | |
tree | 381c94fa2a98f6f77cb670916274de242c2d0330 /source3/torture | |
parent | 8ac68fc3cbff6acb9b780f01a61c2457555fd579 (diff) | |
download | samba-cba5a26734686deeed4785eabd87d7608b3d90f4.tar.gz samba-cba5a26734686deeed4785eabd87d7608b3d90f4.tar.bz2 samba-cba5a26734686deeed4785eabd87d7608b3d90f4.zip |
s3: Convert try_trans2 to cli_trans
Diffstat (limited to 'source3/torture')
-rw-r--r-- | source3/torture/scanner.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/source3/torture/scanner.c b/source3/torture/scanner.c index e499ffcdbe..fa7d6fbe39 100644 --- a/source3/torture/scanner.c +++ b/source3/torture/scanner.c @@ -50,40 +50,40 @@ check for existance of a trans2 call ****************************************************************************/ static NTSTATUS try_trans2(struct cli_state *cli, int op, - char *param, char *data, - int param_len, int data_len, - unsigned int *rparam_len, unsigned int *rdata_len) + uint8_t *param, uint8_t *data, + uint32_t param_len, uint32_t data_len, + uint32_t *rparam_len, uint32_t *rdata_len) { - uint16 setup = op; - char *rparam=NULL, *rdata=NULL; - - if (!cli_send_trans(cli, SMBtrans2, - NULL, /* name */ - -1, 0, /* fid, flags */ - &setup, 1, 0, /* setup, length, max */ - param, param_len, 2, /* param, length, max */ - data, data_len, cli->max_xmit /* data, length, max */ - )) { - return cli_nt_error(cli); - } + uint16_t setup[1]; + uint8_t *rparam=NULL, *rdata=NULL; + NTSTATUS status; - cli_receive_trans(cli, SMBtrans2, - &rparam, rparam_len, - &rdata, rdata_len); + SSVAL(setup+0, 0, op); - SAFE_FREE(rdata); - SAFE_FREE(rparam); + status = cli_trans(talloc_tos(), cli, SMBtrans2, + NULL, -1, /* name, fid */ + op, 0, + NULL, 0, 0, /* setup */ + param, param_len, 2, + data, data_len, cli->max_xmit, + NULL, /* recv_flags2 */ + NULL, 0, NULL, /* rsetup */ + &rparam, 0, rparam_len, + &rdata, 0, rdata_len); - return cli_nt_error(cli); + TALLOC_FREE(rdata); + TALLOC_FREE(rparam); + + return status; } static NTSTATUS try_trans2_len(struct cli_state *cli, const char *format, int op, int level, - char *param, char *data, - int param_len, int *data_len, - unsigned int *rparam_len, unsigned int *rdata_len) + uint8_t *param, uint8_t *data, + uint32_t param_len, uint32_t *data_len, + uint32_t *rparam_len, uint32_t *rdata_len) { NTSTATUS ret=NT_STATUS_OK; @@ -116,10 +116,10 @@ check for existance of a trans2 call static bool scan_trans2(struct cli_state *cli, int op, int level, int fnum, int dnum, const char *fname) { - int data_len = 0; - int param_len = 0; - unsigned int rparam_len, rdata_len; - char param[PARAM_SIZE], data[DATA_SIZE]; + uint32_t data_len = 0; + uint32_t param_len = 0; + uint32_t rparam_len, rdata_len; + uint8_t param[PARAM_SIZE], data[DATA_SIZE]; NTSTATUS status; memset(data, 0, sizeof(data)); |