summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorUri Simchoni <uri@samba.org>2016-09-21 18:37:40 +0300
committerJeremy Allison <jra@samba.org>2016-10-04 02:00:23 +0200
commit5e9b1f77add716168283b3557d0ddc0cf175b6d7 (patch)
tree9341aa3c687c78943a4411d93c81af268a7a6d58 /source3/utils
parenta1d9090e3c00283beb3ecf599a2b29a8fc08dfbf (diff)
downloadsamba-5e9b1f77add716168283b3557d0ddc0cf175b6d7.tar.gz
cliquota: factor out building of FILE_QUOTA_INFORMATION
Add a function to build a FILE_QUOTA_INFORMATION buffer out of a quota list, and a function that adds a record to a quota list. Some parameters of the new functions are unused by client code, but will be used by server code. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/smbcquotas.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source3/utils/smbcquotas.c b/source3/utils/smbcquotas.c
index cda5f922c4f..c1224573541 100644
--- a/source3/utils/smbcquotas.c
+++ b/source3/utils/smbcquotas.c
@@ -339,6 +339,7 @@ static int do_quota(struct cli_state *cli,
uint32_t fs_attrs = 0;
uint16_t quota_fnum = 0;
SMB_NTQUOTA_LIST *qtl = NULL;
+ TALLOC_CTX *qtl_ctx = NULL;
SMB_NTQUOTA_STRUCT qt;
NTSTATUS status;
@@ -386,8 +387,21 @@ static int do_quota(struct cli_state *cli,
break;
case QUOTA_SETLIM:
pqt->sid = qt.sid;
+ if ((qtl_ctx = talloc_init(
+ "SMB_USER_QUOTA_SET")) ==
+ NULL) {
+ return -1;
+ }
+
+ if (!add_record_to_ntquota_list(
+ qtl_ctx, pqt, &qtl)) {
+ TALLOC_FREE(qtl_ctx);
+ return -1;
+ }
+
status = cli_set_user_quota(
- cli, quota_fnum, pqt);
+ cli, quota_fnum, qtl);
+ free_ntquota_list(&qtl);
if (!NT_STATUS_IS_OK(status)) {
d_printf("%s cli_set_user_quota %s\n",
nt_errstr(status),