summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-01-09 10:53:04 +0100
committerVolker Lendecke <vlendec@samba.org>2011-01-09 11:40:04 +0100
commitb57721faafad749f01df22bf555841aac158fa71 (patch)
treec692376ab0e6694b59bdc6bcf00d025b4f7d84e2 /source3
parent3274d80ffd19ccb5e5783f7577909121d8111854 (diff)
downloadsamba-b57721faafad749f01df22bf555841aac158fa71.tar.gz
samba-b57721faafad749f01df22bf555841aac158fa71.tar.bz2
samba-b57721faafad749f01df22bf555841aac158fa71.zip
s3: Convert enc_blob_send_receive to cli_trans()
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Sun Jan 9 11:40:04 CET 2011 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/clifsinfo.c55
1 files changed, 21 insertions, 34 deletions
diff --git a/source3/libsmb/clifsinfo.c b/source3/libsmb/clifsinfo.c
index 69e6546b5d..a5f58bba8a 100644
--- a/source3/libsmb/clifsinfo.c
+++ b/source3/libsmb/clifsinfo.c
@@ -519,48 +519,35 @@ NTSTATUS cli_get_posix_fs_info(struct cli_state *cli,
static NTSTATUS enc_blob_send_receive(struct cli_state *cli, DATA_BLOB *in, DATA_BLOB *out, DATA_BLOB *param_out)
{
- uint16 setup;
- char param[4];
- char *rparam=NULL, *rdata=NULL;
- unsigned int rparam_count=0, rdata_count=0;
- NTSTATUS status = NT_STATUS_OK;
-
- setup = TRANSACT2_SETFSINFO;
+ uint16_t setup[1];
+ uint8_t param[4];
+ uint8_t *rparam=NULL, *rdata=NULL;
+ uint32_t num_rparam, num_rdata;
+ NTSTATUS status;
+ SSVAL(setup+0, 0, TRANSACT2_SETFSINFO);
SSVAL(param,0,0);
SSVAL(param,2,SMB_REQUEST_TRANSPORT_ENCRYPTION);
- if (!cli_send_trans(cli, SMBtrans2,
- NULL,
- 0, 0,
- &setup, 1, 0,
- param, 4, 0,
- (char *)in->data, in->length, CLI_BUFFER_SIZE)) {
- status = cli_nt_error(cli);
- goto out;
- }
-
- if (!cli_receive_trans(cli, SMBtrans2,
- &rparam, &rparam_count,
- &rdata, &rdata_count)) {
- status = cli_nt_error(cli);
- goto out;
- }
+ status = cli_trans(talloc_tos(), cli, SMBtrans2, NULL, 0, 0, 0,
+ setup, 1, 0,
+ param, 4, 2,
+ (uint8_t *)in->data, in->length, CLI_BUFFER_SIZE,
+ NULL, /* recv_flags */
+ NULL, 0, NULL, /* rsetup */
+ &rparam, 0, &num_rparam,
+ &rdata, 0, &num_rdata);
- if (cli_is_error(cli)) {
- status = cli_nt_error(cli);
- if (!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
- goto out;
- }
+ if (!NT_STATUS_IS_OK(status) &&
+ !NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
+ return status;
}
- *out = data_blob(rdata, rdata_count);
- *param_out = data_blob(rparam, rparam_count);
-
- out:
+ *out = data_blob(rdata, num_rdata);
+ *param_out = data_blob(rparam, num_rparam);
- SAFE_FREE(rparam);
- SAFE_FREE(rdata);
+ TALLOC_FREE(rparam);
+ TALLOC_FREE(rdata);
return status;
}