diff options
author | Volker Lendecke <vl@samba.org> | 2011-01-16 12:14:26 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2011-01-17 08:03:41 +0100 |
commit | a1f541723d40f95e7fff13e8c06a037306deccce (patch) | |
tree | c4a6e808f9226946e13e6c0addfe82a266220f95 /source3/libsmb | |
parent | 797c027cc898a88ec7873a3d34908b09eb2e68ce (diff) | |
download | samba-a1f541723d40f95e7fff13e8c06a037306deccce.tar.gz samba-a1f541723d40f95e7fff13e8c06a037306deccce.tar.bz2 samba-a1f541723d40f95e7fff13e8c06a037306deccce.zip |
s3: Convert cli_set_fs_quota_info to cli_trans
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/cliquota.c | 53 |
1 files changed, 21 insertions, 32 deletions
diff --git a/source3/libsmb/cliquota.c b/source3/libsmb/cliquota.c index bfa24687f0..be52f9b086 100644 --- a/source3/libsmb/cliquota.c +++ b/source3/libsmb/cliquota.c @@ -458,15 +458,14 @@ NTSTATUS cli_get_fs_quota_info(struct cli_state *cli, int quota_fnum, return status; } -bool cli_set_fs_quota_info(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUCT *pqt) +NTSTATUS cli_set_fs_quota_info(struct cli_state *cli, int quota_fnum, + SMB_NTQUOTA_STRUCT *pqt) { - bool ret = False; - uint16 setup; - char param[4]; - char data[48]; - char *rparam=NULL, *rdata=NULL; - unsigned int rparam_count=0, rdata_count=0; + uint16_t setup[1]; + uint8_t param[4]; + uint8_t data[48]; SMB_NTQUOTA_STRUCT qt; + NTSTATUS status; ZERO_STRUCT(qt); memset(data,'\0',48); @@ -474,7 +473,7 @@ bool cli_set_fs_quota_info(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_ST smb_panic("cli_set_fs_quota_info() called with NULL Pointer!"); } - setup = TRANSACT2_SETFSINFO; + SSVAL(setup + 0, 0,TRANSACT2_SETFSINFO); SSVAL(param,0,quota_fnum); SSVAL(param,2,SMB_FS_QUOTA_INFORMATION); @@ -492,33 +491,23 @@ bool cli_set_fs_quota_info(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_ST /* Unknown3 6 NULL bytes */ - if (!cli_send_trans(cli, SMBtrans2, - NULL, - 0, 0, - &setup, 1, 0, - param, 4, 0, - data, 48, 0)) { - goto cleanup; - } - - if (!cli_receive_trans(cli, SMBtrans2, - &rparam, &rparam_count, - &rdata, &rdata_count)) { - goto cleanup; - } + status = cli_trans(talloc_tos(), cli, SMBtrans2, + NULL, -1, /* name, fid */ + 0, 0, /* function, flags */ + setup, 1, 0, /* setup */ + param, 8, 0, /* param */ + data, 48, 0, /* data */ + NULL, /* recv_flags2 */ + NULL, 0, NULL, /* rsetup */ + NULL, 0, NULL, /* rparam */ + NULL, 0, NULL); /* rdata */ - if (cli_is_error(cli)) { - ret = False; - goto cleanup; - } else { - ret = True; + if (!NT_STATUS_IS_OK(status)) { + DEBUG(1, ("SMB_FS_QUOTA_INFORMATION failed: %s\n", + nt_errstr(status))); } -cleanup: - SAFE_FREE(rparam); - SAFE_FREE(rdata); - - return ret; + return status; } static const char *quota_str_static(uint64_t val, bool special, bool _numeric) |