2 Unix SMB/CIFS implementation.
3 SMB NT transaction handling
4 Copyright (C) Jeremy Allison 1994-2007
5 Copyright (C) Stefan (metze) Metzmacher 2003
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "system/filesys.h"
23 #include "smbd/smbd.h"
24 #include "smbd/globals.h"
25 #include "fake_file.h"
26 #include "../libcli/security/security.h"
27 #include "../librpc/gen_ndr/ndr_security.h"
28 #include "passdb/lookup_sid.h"
30 #include "smbprofile.h"
31 #include "libsmb/libsmb.h"
32 #include "lib/util_ea.h"
33 #include "librpc/gen_ndr/ndr_quota.h"
34 #include "librpc/gen_ndr/ndr_security.h"
36 extern const struct generic_mapping file_generic_mapping
;
38 /*********************************************************************
39 Windows seems to do canonicalization of inheritance bits. Do the
41 *********************************************************************/
43 static void canonicalize_inheritance_bits(struct files_struct
*fsp
,
44 struct security_descriptor
*psd
)
46 bool set_auto_inherited
= false;
49 * We need to filter out the
50 * SEC_DESC_DACL_AUTO_INHERITED|SEC_DESC_DACL_AUTO_INHERIT_REQ
51 * bits. If both are set we store SEC_DESC_DACL_AUTO_INHERITED
52 * as this alters whether SEC_ACE_FLAG_INHERITED_ACE is set
53 * when an ACE is inherited. Otherwise we zero these bits out.
56 * http://social.msdn.microsoft.com/Forums/eu/os_fileservices/thread/11f77b68-731e-407d-b1b3-064750716531
61 if (!lp_acl_flag_inherited_canonicalization(SNUM(fsp
->conn
))) {
62 psd
->type
&= ~SEC_DESC_DACL_AUTO_INHERIT_REQ
;
66 if ((psd
->type
& (SEC_DESC_DACL_AUTO_INHERITED
|SEC_DESC_DACL_AUTO_INHERIT_REQ
))
67 == (SEC_DESC_DACL_AUTO_INHERITED
|SEC_DESC_DACL_AUTO_INHERIT_REQ
)) {
68 set_auto_inherited
= true;
71 psd
->type
&= ~(SEC_DESC_DACL_AUTO_INHERITED
|SEC_DESC_DACL_AUTO_INHERIT_REQ
);
72 if (set_auto_inherited
) {
73 psd
->type
|= SEC_DESC_DACL_AUTO_INHERITED
;
77 /****************************************************************************
78 Internal fn to set security descriptors.
79 ****************************************************************************/
81 NTSTATUS
set_sd(files_struct
*fsp
, struct security_descriptor
*psd
,
82 uint32_t security_info_sent
)
84 files_struct
*sd_fsp
= NULL
;
87 if (!CAN_WRITE(fsp
->conn
)) {
88 return NT_STATUS_ACCESS_DENIED
;
91 if (!lp_nt_acl_support(SNUM(fsp
->conn
))) {
95 status
= refuse_symlink_fsp(fsp
);
96 if (!NT_STATUS_IS_OK(status
)) {
97 DBG_DEBUG("ACL set on symlink %s denied.\n",
102 if (psd
->owner_sid
== NULL
) {
103 security_info_sent
&= ~SECINFO_OWNER
;
105 if (psd
->group_sid
== NULL
) {
106 security_info_sent
&= ~SECINFO_GROUP
;
109 /* Ensure we have at least one thing set. */
110 if ((security_info_sent
& (SECINFO_OWNER
|SECINFO_GROUP
|SECINFO_DACL
|SECINFO_SACL
)) == 0) {
115 /* Ensure we have the rights to do this. */
116 if (security_info_sent
& SECINFO_OWNER
) {
117 if (!(fsp
->access_mask
& SEC_STD_WRITE_OWNER
)) {
118 return NT_STATUS_ACCESS_DENIED
;
122 if (security_info_sent
& SECINFO_GROUP
) {
123 if (!(fsp
->access_mask
& SEC_STD_WRITE_OWNER
)) {
124 return NT_STATUS_ACCESS_DENIED
;
128 if (security_info_sent
& SECINFO_DACL
) {
129 if (!(fsp
->access_mask
& SEC_STD_WRITE_DAC
)) {
130 return NT_STATUS_ACCESS_DENIED
;
132 /* Convert all the generic bits. */
134 security_acl_map_generic(psd
->dacl
, &file_generic_mapping
);
138 if (security_info_sent
& SECINFO_SACL
) {
139 if (!(fsp
->access_mask
& SEC_FLAG_SYSTEM_SECURITY
)) {
140 return NT_STATUS_ACCESS_DENIED
;
143 * Setting a SACL also requires WRITE_DAC.
144 * See the smbtorture3 SMB2-SACL test.
146 if (!(fsp
->access_mask
& SEC_STD_WRITE_DAC
)) {
147 return NT_STATUS_ACCESS_DENIED
;
149 /* Convert all the generic bits. */
151 security_acl_map_generic(psd
->sacl
, &file_generic_mapping
);
155 canonicalize_inheritance_bits(fsp
, psd
);
157 if (DEBUGLEVEL
>= 10) {
158 DEBUG(10,("set_sd for file %s\n", fsp_str_dbg(fsp
)));
159 NDR_PRINT_DEBUG(security_descriptor
, psd
);
162 sd_fsp
= metadata_fsp(fsp
);
163 status
= SMB_VFS_FSET_NT_ACL(sd_fsp
, security_info_sent
, psd
);
170 /****************************************************************************
171 Internal fn to set security descriptors from a data blob.
172 ****************************************************************************/
174 NTSTATUS
set_sd_blob(files_struct
*fsp
, uint8_t *data
, uint32_t sd_len
,
175 uint32_t security_info_sent
)
177 struct security_descriptor
*psd
= NULL
;
181 return NT_STATUS_INVALID_PARAMETER
;
184 status
= unmarshall_sec_desc(talloc_tos(), data
, sd_len
, &psd
);
186 if (!NT_STATUS_IS_OK(status
)) {
190 return set_sd(fsp
, psd
, security_info_sent
);
193 /****************************************************************************
195 ****************************************************************************/
197 NTSTATUS
copy_internals(TALLOC_CTX
*ctx
,
198 connection_struct
*conn
,
199 struct smb_request
*req
,
200 struct files_struct
*src_dirfsp
,
201 struct smb_filename
*smb_fname_src
,
202 struct files_struct
*dst_dirfsp
,
203 struct smb_filename
*smb_fname_dst
,
206 files_struct
*fsp1
,*fsp2
;
210 NTSTATUS status
= NT_STATUS_OK
;
211 struct smb_filename
*parent
= NULL
;
212 struct smb_filename
*pathref
= NULL
;
214 if (!CAN_WRITE(conn
)) {
215 status
= NT_STATUS_MEDIA_WRITE_PROTECTED
;
219 /* Source must already exist. */
220 if (!VALID_STAT(smb_fname_src
->st
)) {
221 status
= NT_STATUS_OBJECT_NAME_NOT_FOUND
;
225 /* Ensure attributes match. */
226 fattr
= fdos_mode(smb_fname_src
->fsp
);
227 if ((fattr
& ~attrs
) & (FILE_ATTRIBUTE_HIDDEN
| FILE_ATTRIBUTE_SYSTEM
)) {
228 status
= NT_STATUS_NO_SUCH_FILE
;
232 /* Disallow if dst file already exists. */
233 if (VALID_STAT(smb_fname_dst
->st
)) {
234 status
= NT_STATUS_OBJECT_NAME_COLLISION
;
238 /* No links from a directory. */
239 if (S_ISDIR(smb_fname_src
->st
.st_ex_mode
)) {
240 status
= NT_STATUS_FILE_IS_A_DIRECTORY
;
244 DEBUG(10,("copy_internals: doing file copy %s to %s\n",
245 smb_fname_str_dbg(smb_fname_src
),
246 smb_fname_str_dbg(smb_fname_dst
)));
248 status
= SMB_VFS_CREATE_FILE(
251 src_dirfsp
, /* dirfsp */
252 smb_fname_src
, /* fname */
253 FILE_READ_DATA
|FILE_READ_ATTRIBUTES
|
254 FILE_READ_EA
, /* access_mask */
255 (FILE_SHARE_READ
| FILE_SHARE_WRITE
| /* share_access */
257 FILE_OPEN
, /* create_disposition*/
258 0, /* create_options */
259 FILE_ATTRIBUTE_NORMAL
, /* file_attributes */
260 NO_OPLOCK
, /* oplock_request */
262 0, /* allocation_size */
263 0, /* private_flags */
268 NULL
, NULL
); /* create context */
270 if (!NT_STATUS_IS_OK(status
)) {
274 status
= SMB_VFS_CREATE_FILE(
277 dst_dirfsp
, /* dirfsp */
278 smb_fname_dst
, /* fname */
279 FILE_WRITE_DATA
|FILE_WRITE_ATTRIBUTES
|
280 FILE_WRITE_EA
, /* access_mask */
281 (FILE_SHARE_READ
| FILE_SHARE_WRITE
| /* share_access */
283 FILE_CREATE
, /* create_disposition*/
284 0, /* create_options */
285 fattr
, /* file_attributes */
286 NO_OPLOCK
, /* oplock_request */
288 0, /* allocation_size */
289 0, /* private_flags */
294 NULL
, NULL
); /* create context */
296 if (!NT_STATUS_IS_OK(status
)) {
297 close_file_free(NULL
, &fsp1
, ERROR_CLOSE
);
301 if (smb_fname_src
->st
.st_ex_size
) {
302 ret
= vfs_transfer_file(fsp1
, fsp2
, smb_fname_src
->st
.st_ex_size
);
306 * As we are opening fsp1 read-only we only expect
307 * an error on close on fsp2 if we are out of space.
308 * Thus we don't look at the error return from the
311 close_file_free(NULL
, &fsp1
, NORMAL_CLOSE
);
313 /* Ensure the modtime is set correctly on the destination file. */
314 set_close_write_time(fsp2
, smb_fname_src
->st
.st_ex_mtime
);
316 status
= close_file_free(NULL
, &fsp2
, NORMAL_CLOSE
);
317 if (!NT_STATUS_IS_OK(status
)) {
318 DBG_WARNING("close_file_free() failed: %s\n",
321 * We can't do much but leak the fsp
326 /* Grrr. We have to do this as open_file_ntcreate adds FILE_ATTRIBUTE_ARCHIVE when it
327 creates the file. This isn't the correct thing to do in the copy
330 status
= SMB_VFS_PARENT_PATHNAME(conn
,
335 if (!NT_STATUS_IS_OK(status
)) {
338 if (smb_fname_dst
->fsp
== NULL
) {
339 status
= synthetic_pathref(parent
,
341 smb_fname_dst
->base_name
,
342 smb_fname_dst
->stream_name
,
345 smb_fname_dst
->flags
,
348 /* should we handle NT_STATUS_OBJECT_NAME_NOT_FOUND specially here ???? */
349 if (!NT_STATUS_IS_OK(status
)) {
353 file_set_dosmode(conn
, pathref
, fattr
, parent
, false);
354 smb_fname_dst
->st
.st_ex_mode
= pathref
->st
.st_ex_mode
;
356 file_set_dosmode(conn
, smb_fname_dst
, fattr
, parent
, false);
360 if (ret
< (off_t
)smb_fname_src
->st
.st_ex_size
) {
361 status
= NT_STATUS_DISK_FULL
;
365 if (!NT_STATUS_IS_OK(status
)) {
366 DEBUG(3,("copy_internals: Error %s copy file %s to %s\n",
367 nt_errstr(status
), smb_fname_str_dbg(smb_fname_src
),
368 smb_fname_str_dbg(smb_fname_dst
)));
374 /******************************************************************************
375 Fake up a completely empty SD.
376 *******************************************************************************/
378 static NTSTATUS
get_null_nt_acl(TALLOC_CTX
*mem_ctx
, struct security_descriptor
**ppsd
)
382 *ppsd
= make_standard_sec_desc( mem_ctx
, &global_sid_World
, &global_sid_World
, NULL
, &sd_size
);
384 DEBUG(0,("get_null_nt_acl: Unable to malloc space for security descriptor.\n"));
385 return NT_STATUS_NO_MEMORY
;
391 /****************************************************************************
392 Get a security descriptor from the file system, normalize for components
394 ****************************************************************************/
396 static NTSTATUS
smbd_fetch_security_desc(connection_struct
*conn
,
399 uint32_t security_info_wanted
,
400 struct security_descriptor
**ppsd
)
403 struct security_descriptor
*psd
= NULL
;
404 bool need_to_read_sd
= false;
407 * Get the permissions to return.
410 if ((security_info_wanted
& SECINFO_SACL
) &&
411 !(fsp
->access_mask
& SEC_FLAG_SYSTEM_SECURITY
)) {
412 DEBUG(10, ("Access to SACL denied.\n"));
413 return NT_STATUS_ACCESS_DENIED
;
416 if ((security_info_wanted
& (SECINFO_DACL
|SECINFO_OWNER
|SECINFO_GROUP
)) &&
417 !(fsp
->access_mask
& SEC_STD_READ_CONTROL
)) {
418 DEBUG(10, ("Access to DACL, OWNER, or GROUP denied.\n"));
419 return NT_STATUS_ACCESS_DENIED
;
422 status
= refuse_symlink_fsp(fsp
);
423 if (!NT_STATUS_IS_OK(status
)) {
424 DBG_DEBUG("ACL get on symlink %s denied.\n",
429 if (security_info_wanted
& (SECINFO_DACL
|SECINFO_OWNER
|
430 SECINFO_GROUP
|SECINFO_SACL
)) {
431 /* Don't return SECINFO_LABEL if anything else was
432 requested. See bug #8458. */
433 security_info_wanted
&= ~SECINFO_LABEL
;
436 * Only query the file system SD if the caller asks
437 * for any bits. This allows a caller to open without
438 * READ_CONTROL but still issue a query sd. See
441 need_to_read_sd
= true;
444 if (lp_nt_acl_support(SNUM(conn
)) &&
445 ((security_info_wanted
& SECINFO_LABEL
) == 0) &&
448 files_struct
*sd_fsp
= metadata_fsp(fsp
);
449 status
= SMB_VFS_FGET_NT_ACL(
450 sd_fsp
, security_info_wanted
, mem_ctx
, &psd
);
452 status
= get_null_nt_acl(mem_ctx
, &psd
);
455 if (!NT_STATUS_IS_OK(status
)) {
459 if (!(security_info_wanted
& SECINFO_OWNER
)) {
460 psd
->owner_sid
= NULL
;
462 if (!(security_info_wanted
& SECINFO_GROUP
)) {
463 psd
->group_sid
= NULL
;
465 if (!(security_info_wanted
& SECINFO_DACL
)) {
466 psd
->type
&= ~SEC_DESC_DACL_PRESENT
;
469 if (!(security_info_wanted
& SECINFO_SACL
)) {
470 psd
->type
&= ~SEC_DESC_SACL_PRESENT
;
474 /* If the SACL/DACL is NULL, but was requested, we mark that it is
475 * present in the reply to match Windows behavior */
476 if (psd
->sacl
== NULL
&&
477 security_info_wanted
& SECINFO_SACL
)
478 psd
->type
|= SEC_DESC_SACL_PRESENT
;
479 if (psd
->dacl
== NULL
&&
480 security_info_wanted
& SECINFO_DACL
)
481 psd
->type
|= SEC_DESC_DACL_PRESENT
;
483 if (security_info_wanted
& SECINFO_LABEL
) {
484 /* Like W2K3 return a null object. */
485 psd
->owner_sid
= NULL
;
486 psd
->group_sid
= NULL
;
489 psd
->type
&= ~(SEC_DESC_DACL_PRESENT
|SEC_DESC_SACL_PRESENT
);
496 /****************************************************************************
497 Write a securty descriptor into marshalled format.
498 ****************************************************************************/
500 static NTSTATUS
smbd_marshall_security_desc(TALLOC_CTX
*mem_ctx
,
502 struct security_descriptor
*psd
,
503 uint32_t max_data_count
,
504 uint8_t **ppmarshalled_sd
,
507 *psd_size
= ndr_size_security_descriptor(psd
, 0);
509 DBG_NOTICE("sd_size = %zu.\n", *psd_size
);
511 if (DEBUGLEVEL
>= 10) {
512 DBG_DEBUG("security desc for file %s\n",
514 NDR_PRINT_DEBUG(security_descriptor
, psd
);
517 if (max_data_count
< *psd_size
) {
518 return NT_STATUS_BUFFER_TOO_SMALL
;
521 return marshall_sec_desc(mem_ctx
,
527 /****************************************************************************
528 Reply to query a security descriptor.
529 Callable from SMB1 and SMB2.
530 If it returns NT_STATUS_BUFFER_TOO_SMALL, psd_size is initialized with
532 ****************************************************************************/
534 NTSTATUS
smbd_do_query_security_desc(connection_struct
*conn
,
537 uint32_t security_info_wanted
,
538 uint32_t max_data_count
,
539 uint8_t **ppmarshalled_sd
,
543 struct security_descriptor
*psd
= NULL
;
546 * Get the permissions to return.
549 status
= smbd_fetch_security_desc(conn
,
552 security_info_wanted
,
554 if (!NT_STATUS_IS_OK(status
)) {
558 status
= smbd_marshall_security_desc(mem_ctx
,
568 #ifdef HAVE_SYS_QUOTAS
569 static enum ndr_err_code
fill_qtlist_from_sids(TALLOC_CTX
*mem_ctx
,
570 struct files_struct
*fsp
,
571 SMB_NTQUOTA_HANDLE
*qt_handle
,
572 struct dom_sid
*sids
,
576 TALLOC_CTX
*list_ctx
= NULL
;
578 list_ctx
= talloc_init("quota_sid_list");
580 if (list_ctx
== NULL
) {
581 DBG_ERR("failed to allocate\n");
582 return NDR_ERR_ALLOC
;
585 if (qt_handle
->quota_list
!=NULL
) {
586 free_ntquota_list(&(qt_handle
->quota_list
));
588 for (i
= 0; i
< elems
; i
++) {
589 SMB_NTQUOTA_STRUCT qt
;
590 SMB_NTQUOTA_LIST
*list_item
;
593 if (!NT_STATUS_IS_OK(vfs_get_ntquota(fsp
,
596 /* non fatal error, return empty item in result */
602 list_item
= talloc_zero(list_ctx
, SMB_NTQUOTA_LIST
);
603 if (list_item
== NULL
) {
604 DBG_ERR("failed to allocate\n");
605 return NDR_ERR_ALLOC
;
608 ok
= sid_to_uid(&sids
[i
], &list_item
->uid
);
610 struct dom_sid_buf buf
;
611 DBG_WARNING("Could not convert SID %s to uid\n",
612 dom_sid_str_buf(&sids
[i
], &buf
));
613 /* No idea what to return here... */
614 return NDR_ERR_INVALID_POINTER
;
617 list_item
->quotas
= talloc_zero(list_item
, SMB_NTQUOTA_STRUCT
);
618 if (list_item
->quotas
== NULL
) {
619 DBG_ERR("failed to allocate\n");
620 return NDR_ERR_ALLOC
;
623 *list_item
->quotas
= qt
;
624 list_item
->mem_ctx
= list_ctx
;
625 DLIST_ADD(qt_handle
->quota_list
, list_item
);
627 qt_handle
->tmp_list
= qt_handle
->quota_list
;
628 return NDR_ERR_SUCCESS
;
631 static enum ndr_err_code
extract_sids_from_buf(TALLOC_CTX
*mem_ctx
,
632 uint32_t sidlistlength
,
634 struct dom_sid
**sids
,
639 enum ndr_err_code err
;
641 struct sid_list_elem
{
642 struct sid_list_elem
*prev
, *next
;
646 struct sid_list_elem
*sid_list
= NULL
;
647 struct sid_list_elem
*iter
= NULL
;
648 TALLOC_CTX
*list_ctx
= talloc_init("sid_list");
660 struct ndr_pull
*ndr_pull
= NULL
;
662 if (sidlistlength
> sid_buf
->length
) {
663 DBG_ERR("sid_list_length 0x%x exceeds "
664 "available bytes %zx\n",
667 err
= NDR_ERR_OFFSET
;
671 struct file_get_quota_info info
;
672 struct sid_list_elem
*item
= NULL
;
673 uint32_t new_offset
= 0;
674 blob
.data
= sid_buf
->data
+ offset
;
675 blob
.length
= sidlistlength
- offset
;
676 ndr_pull
= ndr_pull_init_blob(&blob
, list_ctx
);
682 err
= ndr_pull_file_get_quota_info(ndr_pull
,
683 NDR_SCALARS
| NDR_BUFFERS
, &info
);
684 if (!NDR_ERR_CODE_IS_SUCCESS(err
)) {
685 DBG_ERR("Failed to pull file_get_quota_info "
686 "from sidlist buffer\n");
689 item
= talloc_zero(list_ctx
, struct sid_list_elem
);
695 item
->sid
= info
.sid
;
696 DLIST_ADD(sid_list
, item
);
698 if (i
== UINT32_MAX
) {
699 DBG_ERR("Integer overflow\n");
700 err
= NDR_ERR_ARRAY_SIZE
;
703 new_offset
= info
.next_entry_offset
;
705 /* if new_offset == 0 no more sid(s) to read. */
706 if (new_offset
== 0) {
711 if ((offset
+ new_offset
) < offset
) {
712 DBG_ERR("Integer wrap while adding "
713 "new_offset 0x%x to current "
714 "buffer offset 0x%x\n",
716 err
= NDR_ERR_OFFSET
;
720 offset
+= new_offset
;
722 /* check if new offset is outside buffer boundry. */
723 if (offset
>= sidlistlength
) {
724 DBG_ERR("bufsize 0x%x exceeded by "
725 "new offset 0x%x)\n",
728 err
= NDR_ERR_OFFSET
;
732 *sids
= talloc_zero_array(mem_ctx
, struct dom_sid
, i
);
741 for (iter
= sid_list
, i
= 0; iter
; iter
= iter
->next
, i
++) {
742 struct dom_sid_buf buf
;
743 (*sids
)[i
] = iter
->sid
;
744 DBG_DEBUG("quota SID[%u] %s\n",
746 dom_sid_str_buf(&iter
->sid
, &buf
));
749 err
= NDR_ERR_SUCCESS
;
751 TALLOC_FREE(list_ctx
);
755 NTSTATUS
smbd_do_query_getinfo_quota(TALLOC_CTX
*mem_ctx
,
759 uint32_t sid_list_length
,
761 uint32_t max_data_count
,
763 uint32_t *p_data_size
)
766 SMB_NTQUOTA_HANDLE
*qt_handle
= NULL
;
767 SMB_NTQUOTA_LIST
*qt_list
= NULL
;
768 DATA_BLOB blob
= data_blob_null
;
769 enum ndr_err_code err
;
772 (SMB_NTQUOTA_HANDLE
*)fsp
->fake_file_handle
->private_data
;
774 if (sid_list_length
) {
775 struct dom_sid
*sids
;
778 * error check pulled offsets and lengths for wrap and
779 * exceeding available bytes.
781 if (sid_list_length
> sid_buf
->length
) {
782 DBG_ERR("sid_list_length 0x%x exceeds "
783 "available bytes %zx\n",
786 return NT_STATUS_INVALID_PARAMETER
;
789 err
= extract_sids_from_buf(mem_ctx
, sid_list_length
,
790 sid_buf
, &sids
, &elems
);
791 if (!NDR_ERR_CODE_IS_SUCCESS(err
) || elems
== 0) {
792 return NT_STATUS_INVALID_PARAMETER
;
794 err
= fill_qtlist_from_sids(mem_ctx
,
799 if (!NDR_ERR_CODE_IS_SUCCESS(err
)) {
800 return NT_STATUS_INVALID_PARAMETER
;
802 } else if (restart_scan
) {
803 if (vfs_get_user_ntquota_list(fsp
,
804 &(qt_handle
->quota_list
))!=0) {
805 return NT_STATUS_INTERNAL_ERROR
;
808 if (qt_handle
->quota_list
!=NULL
&&
809 qt_handle
->tmp_list
==NULL
) {
810 free_ntquota_list(&(qt_handle
->quota_list
));
814 if (restart_scan
!=0 ) {
815 qt_list
= qt_handle
->quota_list
;
817 qt_list
= qt_handle
->tmp_list
;
819 status
= fill_quota_buffer(mem_ctx
, qt_list
,
823 &qt_handle
->tmp_list
);
824 if (!NT_STATUS_IS_OK(status
)) {
827 if (blob
.length
> max_data_count
) {
828 return NT_STATUS_BUFFER_TOO_SMALL
;
832 *p_data_size
= blob
.length
;
835 #endif /* HAVE_SYS_QUOTAS */