2 * Store Windows ACLs in data store - common functions.
3 * #included into modules/vfs_acl_xattr.c and modules/vfs_acl_tdb.c
5 * Copyright (C) Volker Lendecke, 2008
6 * Copyright (C) Jeremy Allison, 2009
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, see <http://www.gnu.org/licenses/>.
22 static NTSTATUS
create_acl_blob(const struct security_descriptor
*psd
,
25 uint8_t hash
[XATTR_SD_HASH_SIZE
]);
27 static NTSTATUS
get_acl_blob(TALLOC_CTX
*ctx
,
28 vfs_handle_struct
*handle
,
33 static NTSTATUS
store_acl_blob_fsp(vfs_handle_struct
*handle
,
37 static NTSTATUS
store_acl_blob_pathname(vfs_handle_struct
*handle
,
41 #define HASH_SECURITY_INFO (OWNER_SECURITY_INFORMATION | \
42 GROUP_SECURITY_INFORMATION | \
43 DACL_SECURITY_INFORMATION | \
44 SACL_SECURITY_INFORMATION)
46 /*******************************************************************
47 Hash a security descriptor.
48 *******************************************************************/
50 static NTSTATUS
hash_sd_sha256(struct security_descriptor
*psd
,
57 memset(hash
, '\0', XATTR_SD_HASH_SIZE
);
58 status
= create_acl_blob(psd
, &blob
, XATTR_SD_HASH_TYPE_SHA256
, hash
);
59 if (!NT_STATUS_IS_OK(status
)) {
64 SHA256_Update(&tctx
, blob
.data
, blob
.length
);
65 SHA256_Final(hash
, &tctx
);
70 /*******************************************************************
71 Parse out a struct security_descriptor from a DATA_BLOB.
72 *******************************************************************/
74 static NTSTATUS
parse_acl_blob(const DATA_BLOB
*pblob
,
75 struct security_descriptor
**ppdesc
,
76 uint16_t *p_hash_type
,
77 uint8_t hash
[XATTR_SD_HASH_SIZE
])
79 TALLOC_CTX
*ctx
= talloc_tos();
80 struct xattr_NTACL xacl
;
81 enum ndr_err_code ndr_err
;
84 ndr_err
= ndr_pull_struct_blob(pblob
, ctx
, NULL
, &xacl
,
85 (ndr_pull_flags_fn_t
)ndr_pull_xattr_NTACL
);
87 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err
)) {
88 DEBUG(5, ("parse_acl_blob: ndr_pull_xattr_NTACL failed: %s\n",
89 ndr_errstr(ndr_err
)));
90 return ndr_map_error2ntstatus(ndr_err
);;
93 switch (xacl
.version
) {
95 *ppdesc
= make_sec_desc(ctx
, SEC_DESC_REVISION
,
96 xacl
.info
.sd_hs2
->sd
->type
| SEC_DESC_SELF_RELATIVE
,
97 xacl
.info
.sd_hs2
->sd
->owner_sid
,
98 xacl
.info
.sd_hs2
->sd
->group_sid
,
99 xacl
.info
.sd_hs2
->sd
->sacl
,
100 xacl
.info
.sd_hs2
->sd
->dacl
,
102 /* No hash - null out. */
103 *p_hash_type
= XATTR_SD_HASH_TYPE_NONE
;
104 memset(hash
, '\0', XATTR_SD_HASH_SIZE
);
107 *ppdesc
= make_sec_desc(ctx
, SEC_DESC_REVISION
,
108 xacl
.info
.sd_hs3
->sd
->type
| SEC_DESC_SELF_RELATIVE
,
109 xacl
.info
.sd_hs3
->sd
->owner_sid
,
110 xacl
.info
.sd_hs3
->sd
->group_sid
,
111 xacl
.info
.sd_hs3
->sd
->sacl
,
112 xacl
.info
.sd_hs3
->sd
->dacl
,
114 *p_hash_type
= xacl
.info
.sd_hs3
->hash_type
;
115 /* Current version 3. */
116 memcpy(hash
, xacl
.info
.sd_hs3
->hash
, XATTR_SD_HASH_SIZE
);
119 return NT_STATUS_REVISION_MISMATCH
;
122 TALLOC_FREE(xacl
.info
.sd
);
124 return (*ppdesc
!= NULL
) ? NT_STATUS_OK
: NT_STATUS_NO_MEMORY
;
127 /*******************************************************************
128 Create a DATA_BLOB from a security descriptor.
129 *******************************************************************/
131 static NTSTATUS
create_acl_blob(const struct security_descriptor
*psd
,
134 uint8_t hash
[XATTR_SD_HASH_SIZE
])
136 struct xattr_NTACL xacl
;
137 struct security_descriptor_hash_v3 sd_hs3
;
138 enum ndr_err_code ndr_err
;
139 TALLOC_CTX
*ctx
= talloc_tos();
145 xacl
.info
.sd_hs3
= &sd_hs3
;
146 xacl
.info
.sd_hs3
->sd
= CONST_DISCARD(struct security_descriptor
*, psd
);
147 xacl
.info
.sd_hs3
->hash_type
= hash_type
;
148 memcpy(&xacl
.info
.sd_hs3
->hash
[0], hash
, XATTR_SD_HASH_SIZE
);
150 ndr_err
= ndr_push_struct_blob(
151 pblob
, ctx
, NULL
, &xacl
,
152 (ndr_push_flags_fn_t
)ndr_push_xattr_NTACL
);
154 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err
)) {
155 DEBUG(5, ("create_acl_blob: ndr_push_xattr_NTACL failed: %s\n",
156 ndr_errstr(ndr_err
)));
157 return ndr_map_error2ntstatus(ndr_err
);;
163 /*******************************************************************
164 Pull a DATA_BLOB from an xattr given a pathname.
165 DOES NOT FALL BACK TO THE UNDERLYING ACLs ON THE FILESYSTEM.
166 *******************************************************************/
168 static NTSTATUS
get_nt_acl_internal(vfs_handle_struct
*handle
,
171 uint32_t security_info
,
172 struct security_descriptor
**ppdesc
)
177 uint8_t hash
[XATTR_SD_HASH_SIZE
];
178 uint8_t hash_tmp
[XATTR_SD_HASH_SIZE
];
179 struct security_descriptor
*pdesc_next
= NULL
;
181 if (fsp
&& name
== NULL
) {
182 name
= fsp
->fsp_name
->base_name
;
185 DEBUG(10, ("get_nt_acl_internal: name=%s\n", name
));
187 status
= get_acl_blob(talloc_tos(), handle
, fsp
, name
, &blob
);
188 if (!NT_STATUS_IS_OK(status
)) {
189 DEBUG(10, ("get_nt_acl_internal: get_acl_blob returned %s\n",
194 status
= parse_acl_blob(&blob
, ppdesc
,
195 &hash_type
, &hash
[0]);
196 if (!NT_STATUS_IS_OK(status
)) {
197 DEBUG(10, ("parse_acl_blob returned %s\n",
202 /* Ensure the hash type is one we know. */
204 case XATTR_SD_HASH_TYPE_NONE
:
205 /* No hash, goto return blob sd. */
207 case XATTR_SD_HASH_TYPE_SHA256
:
210 return NT_STATUS_REVISION_MISMATCH
;
213 /* Get the full underlying sd, then hash. */
215 status
= SMB_VFS_NEXT_FGET_NT_ACL(handle
,
220 status
= SMB_VFS_NEXT_GET_NT_ACL(handle
,
226 if (!NT_STATUS_IS_OK(status
)) {
230 status
= hash_sd_sha256(pdesc_next
, hash_tmp
);
231 if (!NT_STATUS_IS_OK(status
)) {
235 if (memcmp(&hash
[0], &hash_tmp
[0], XATTR_SD_HASH_SIZE
) == 0) {
236 TALLOC_FREE(pdesc_next
);
237 /* Hash matches, return blob sd. */
241 /* Hash doesn't match, return underlying sd. */
243 if (!(security_info
& OWNER_SECURITY_INFORMATION
)) {
244 pdesc_next
->owner_sid
= NULL
;
246 if (!(security_info
& GROUP_SECURITY_INFORMATION
)) {
247 pdesc_next
->group_sid
= NULL
;
249 if (!(security_info
& DACL_SECURITY_INFORMATION
)) {
250 pdesc_next
->dacl
= NULL
;
252 if (!(security_info
& SACL_SECURITY_INFORMATION
)) {
253 pdesc_next
->sacl
= NULL
;
256 TALLOC_FREE(*ppdesc
);
257 *ppdesc
= pdesc_next
;
261 if (!(security_info
& OWNER_SECURITY_INFORMATION
)) {
262 (*ppdesc
)->owner_sid
= NULL
;
264 if (!(security_info
& GROUP_SECURITY_INFORMATION
)) {
265 (*ppdesc
)->group_sid
= NULL
;
267 if (!(security_info
& DACL_SECURITY_INFORMATION
)) {
268 (*ppdesc
)->dacl
= NULL
;
270 if (!(security_info
& SACL_SECURITY_INFORMATION
)) {
271 (*ppdesc
)->sacl
= NULL
;
274 TALLOC_FREE(blob
.data
);
278 /*********************************************************************
279 Create a default security descriptor for a file in case no inheritance
280 exists. All permissions to the owner and SYSTEM.
281 *********************************************************************/
283 static struct security_descriptor
*default_file_sd(TALLOC_CTX
*mem_ctx
,
284 SMB_STRUCT_STAT
*psbuf
,
287 struct dom_sid owner_sid
, group_sid
;
289 struct security_ace
*pace
= NULL
;
290 struct security_acl
*pacl
= NULL
;
292 uid_to_sid(&owner_sid
, psbuf
->st_ex_uid
);
293 gid_to_sid(&group_sid
, psbuf
->st_ex_gid
);
295 pace
= TALLOC_ARRAY(mem_ctx
, struct security_ace
, 2);
300 /* If force_inherit is set, this means we are initializing the ACEs for
301 * a container and we want the ACEs for owner_sid and "SYSTEM" to be
302 * inheritable by their children (See Bug #6802).
305 init_sec_ace(&pace
[0], &owner_sid
, SEC_ACE_TYPE_ACCESS_ALLOWED
,
306 SEC_RIGHTS_FILE_ALL
, (force_inherit
?
307 (SEC_ACE_FLAG_OBJECT_INHERIT
|
308 SEC_ACE_FLAG_CONTAINER_INHERIT
) :
311 init_sec_ace(&pace
[1], &global_sid_System
, SEC_ACE_TYPE_ACCESS_ALLOWED
,
312 SEC_RIGHTS_FILE_ALL
, (force_inherit
?
313 (SEC_ACE_FLAG_OBJECT_INHERIT
|
314 SEC_ACE_FLAG_CONTAINER_INHERIT
) :
317 pacl
= make_sec_acl(mem_ctx
,
324 return make_sec_desc(mem_ctx
,
325 SECURITY_DESCRIPTOR_REVISION_1
,
326 SEC_DESC_SELF_RELATIVE
|SEC_DESC_DACL_PRESENT
,
334 /*********************************************************************
335 *********************************************************************/
337 static NTSTATUS
inherit_new_acl(vfs_handle_struct
*handle
,
338 struct smb_filename
*smb_fname
,
342 TALLOC_CTX
*ctx
= talloc_tos();
344 struct security_descriptor
*parent_desc
= NULL
;
345 struct security_descriptor
*psd
= NULL
;
346 struct security_descriptor
*pdesc_next
= NULL
;
350 bool force_inherit
= false;
351 uint8_t hash
[XATTR_SD_HASH_SIZE
];
353 if (!parent_dirname(ctx
, smb_fname
->base_name
, &parent_name
, NULL
)) {
354 return NT_STATUS_NO_MEMORY
;
357 DEBUG(10,("inherit_new_acl: check directory %s\n",
360 status
= get_nt_acl_internal(handle
,
363 (OWNER_SECURITY_INFORMATION
|
364 GROUP_SECURITY_INFORMATION
|
365 DACL_SECURITY_INFORMATION
),
367 if (NT_STATUS_IS_OK(status
)) {
368 /* Create an inherited descriptor from the parent. */
370 if (DEBUGLEVEL
>= 10) {
371 DEBUG(10,("inherit_new_acl: parent acl is:\n"));
372 NDR_PRINT_DEBUG(security_descriptor
, parent_desc
);
375 status
= se_create_child_secdesc(ctx
,
379 &handle
->conn
->server_info
->ptok
->user_sids
[PRIMARY_USER_SID_INDEX
],
380 &handle
->conn
->server_info
->ptok
->user_sids
[PRIMARY_GROUP_SID_INDEX
],
382 if (!NT_STATUS_IS_OK(status
)) {
386 if (DEBUGLEVEL
>= 10) {
387 DEBUG(10,("inherit_new_acl: child acl is:\n"));
388 NDR_PRINT_DEBUG(security_descriptor
, psd
);
392 DEBUG(10,("inherit_new_acl: directory %s failed "
395 nt_errstr(status
) ));
398 if (!psd
|| psd
->dacl
== NULL
) {
402 status
= vfs_stat_fsp(fsp
);
403 smb_fname
->st
= fsp
->fsp_name
->st
;
406 if (lp_posix_pathnames()) {
407 ret
= SMB_VFS_LSTAT(handle
->conn
, smb_fname
);
409 ret
= SMB_VFS_STAT(handle
->conn
, smb_fname
);
412 status
= map_nt_error_from_unix(errno
);
415 if (!NT_STATUS_IS_OK(status
)) {
419 /* If we get here, we could have the following possibilities:
420 * 1. No ACLs exist on the parent container.
421 * 2. ACLs exist on the parent container but they were
424 * Check to see if case #1 occurred.
428 (parent_desc
== NULL
|| parent_desc
->dacl
== NULL
)) {
430 /* If no parent descriptor exists, then there were
431 * no ACLs on the parent and then we must create
432 * the ACLs on this newly created folder so that they
433 * will be inherited by their children (See Bug #6802).
436 force_inherit
= true;
439 psd
= default_file_sd(ctx
, &smb_fname
->st
, force_inherit
);
441 return NT_STATUS_NO_MEMORY
;
444 if (DEBUGLEVEL
>= 10) {
445 DEBUG(10,("inherit_new_acl: default acl is:\n"));
446 NDR_PRINT_DEBUG(security_descriptor
, psd
);
450 /* Object exists. Read the current SD to get the hash. */
452 status
= SMB_VFS_NEXT_FGET_NT_ACL(handle
,
457 status
= SMB_VFS_NEXT_GET_NT_ACL(handle
,
458 smb_fname
->base_name
,
463 if (!NT_STATUS_IS_OK(status
)) {
467 status
= hash_sd_sha256(pdesc_next
, hash
);
468 if (!NT_STATUS_IS_OK(status
)) {
471 status
= create_acl_blob(psd
, &blob
, XATTR_SD_HASH_TYPE_SHA256
, hash
);
472 if (!NT_STATUS_IS_OK(status
)) {
476 return store_acl_blob_fsp(handle
, fsp
, &blob
);
478 return store_acl_blob_pathname(handle
, smb_fname
->base_name
,
483 static NTSTATUS
check_parent_acl_common(vfs_handle_struct
*handle
,
485 uint32_t access_mask
)
487 char *parent_name
= NULL
;
488 struct security_descriptor
*parent_desc
= NULL
;
489 uint32_t access_granted
= 0;
492 if (!parent_dirname(talloc_tos(), path
, &parent_name
, NULL
)) {
493 return NT_STATUS_NO_MEMORY
;
496 status
= SMB_VFS_GET_NT_ACL(handle
->conn
,
498 (OWNER_SECURITY_INFORMATION
|
499 GROUP_SECURITY_INFORMATION
|
500 DACL_SECURITY_INFORMATION
),
502 if (!NT_STATUS_IS_OK(status
)) {
503 DEBUG(10,("check_parent_acl_common: SMB_VFS_GET_NT_ACL "
504 "on directory %s for "
505 "path %s returned %s\n",
508 nt_errstr(status
) ));
511 status
= smb1_file_se_access_check(parent_desc
,
512 handle
->conn
->server_info
->ptok
,
515 if(!NT_STATUS_IS_OK(status
)) {
516 DEBUG(10,("check_parent_acl_common: access check "
517 "on directory %s for "
518 "path %s for mask 0x%x returned %s\n",
522 nt_errstr(status
) ));
528 /*********************************************************************
529 Check ACL on open. For new files inherit from parent directory.
530 *********************************************************************/
532 static int open_acl_common(vfs_handle_struct
*handle
,
533 struct smb_filename
*smb_fname
,
538 uint32_t access_granted
= 0;
539 struct security_descriptor
*pdesc
= NULL
;
540 bool file_existed
= true;
545 /* Stream open. Base filename open already did the ACL check. */
546 DEBUG(10,("open_acl_common: stream open on %s\n",
547 smb_fname_str_dbg(smb_fname
) ));
548 return SMB_VFS_NEXT_OPEN(handle
, smb_fname
, fsp
, flags
, mode
);
551 status
= get_full_smb_filename(talloc_tos(), smb_fname
,
553 if (!NT_STATUS_IS_OK(status
)) {
557 status
= get_nt_acl_internal(handle
,
560 (OWNER_SECURITY_INFORMATION
|
561 GROUP_SECURITY_INFORMATION
|
562 DACL_SECURITY_INFORMATION
),
564 if (NT_STATUS_IS_OK(status
)) {
565 /* See if we can access it. */
566 status
= smb1_file_se_access_check(pdesc
,
567 handle
->conn
->server_info
->ptok
,
570 if (!NT_STATUS_IS_OK(status
)) {
571 DEBUG(10,("open_acl_xattr: file %s open "
572 "refused with error %s\n",
573 smb_fname_str_dbg(smb_fname
),
574 nt_errstr(status
) ));
577 } else if (NT_STATUS_EQUAL(status
,NT_STATUS_OBJECT_NAME_NOT_FOUND
)) {
578 file_existed
= false;
580 * If O_CREAT is true then we're trying to create a file.
581 * Check the parent directory ACL will allow this.
583 if (flags
& O_CREAT
) {
584 status
= check_parent_acl_common(handle
, fname
,
586 if (!NT_STATUS_IS_OK(status
)) {
592 DEBUG(10,("open_acl_xattr: get_nt_acl_attr_internal for "
593 "file %s returned %s\n",
594 smb_fname_str_dbg(smb_fname
),
595 nt_errstr(status
) ));
597 fsp
->fh
->fd
= SMB_VFS_NEXT_OPEN(handle
, smb_fname
, fsp
, flags
, mode
);
599 if (!file_existed
&& fsp
->fh
->fd
!= -1) {
600 /* File was created. Inherit from parent directory. */
601 status
= fsp_set_smb_fname(fsp
, smb_fname
);
602 if (!NT_STATUS_IS_OK(status
)) {
605 inherit_new_acl(handle
, smb_fname
, fsp
, false);
612 errno
= map_errno_from_nt_status(status
);
616 static int mkdir_acl_common(vfs_handle_struct
*handle
, const char *path
, mode_t mode
)
618 struct smb_filename
*smb_fname
= NULL
;
621 SMB_STRUCT_STAT sbuf
;
623 ret
= vfs_stat_smb_fname(handle
->conn
, path
, &sbuf
);
624 if (ret
== -1 && errno
== ENOENT
) {
625 /* We're creating a new directory. */
626 status
= check_parent_acl_common(handle
, path
,
628 if (!NT_STATUS_IS_OK(status
)) {
629 errno
= map_errno_from_nt_status(status
);
634 ret
= SMB_VFS_NEXT_MKDIR(handle
, path
, mode
);
639 status
= create_synthetic_smb_fname(talloc_tos(), path
, NULL
, NULL
,
641 if (!NT_STATUS_IS_OK(status
)) {
642 errno
= map_errno_from_nt_status(status
);
646 /* New directory - inherit from parent. */
647 inherit_new_acl(handle
, smb_fname
, NULL
, true);
648 TALLOC_FREE(smb_fname
);
652 /*********************************************************************
653 Fetch a security descriptor given an fsp.
654 *********************************************************************/
656 static NTSTATUS
fget_nt_acl_common(vfs_handle_struct
*handle
, files_struct
*fsp
,
657 uint32_t security_info
, struct security_descriptor
**ppdesc
)
659 NTSTATUS status
= get_nt_acl_internal(handle
, fsp
,
660 NULL
, security_info
, ppdesc
);
661 if (NT_STATUS_EQUAL(status
, NT_STATUS_NOT_FOUND
)) {
662 /* Pull the ACL from the underlying system. */
663 status
= SMB_VFS_NEXT_FGET_NT_ACL(handle
,
671 /*********************************************************************
672 Fetch a security descriptor given a pathname.
673 *********************************************************************/
675 static NTSTATUS
get_nt_acl_common(vfs_handle_struct
*handle
,
676 const char *name
, uint32_t security_info
, struct security_descriptor
**ppdesc
)
678 NTSTATUS status
= get_nt_acl_internal(handle
, NULL
,
679 name
, security_info
, ppdesc
);
680 if (NT_STATUS_EQUAL(status
, NT_STATUS_NOT_FOUND
)) {
681 /* Pull the ACL from the underlying system. */
682 status
= SMB_VFS_NEXT_GET_NT_ACL(handle
,
690 /*********************************************************************
691 Store a security descriptor given an fsp.
692 *********************************************************************/
694 static NTSTATUS
fset_nt_acl_common(vfs_handle_struct
*handle
, files_struct
*fsp
,
695 uint32_t security_info_sent
, const struct security_descriptor
*psd
)
699 struct security_descriptor
*pdesc_next
= NULL
;
700 uint8_t hash
[XATTR_SD_HASH_SIZE
];
702 if (DEBUGLEVEL
>= 10) {
703 DEBUG(10,("fset_nt_acl_xattr: incoming sd for file %s\n",
705 NDR_PRINT_DEBUG(security_descriptor
,
706 CONST_DISCARD(struct security_descriptor
*,psd
));
709 /* Ensure we have OWNER/GROUP/DACL set. */
711 if ((security_info_sent
& (OWNER_SECURITY_INFORMATION
|
712 GROUP_SECURITY_INFORMATION
|
713 DACL_SECURITY_INFORMATION
)) !=
714 (OWNER_SECURITY_INFORMATION
|
715 GROUP_SECURITY_INFORMATION
|
716 DACL_SECURITY_INFORMATION
)) {
717 /* No we don't - read from the existing SD. */
718 struct security_descriptor
*nc_psd
= NULL
;
720 status
= get_nt_acl_internal(handle
, fsp
,
722 (OWNER_SECURITY_INFORMATION
|
723 GROUP_SECURITY_INFORMATION
|
724 DACL_SECURITY_INFORMATION
),
727 if (!NT_STATUS_IS_OK(status
)) {
731 /* This is safe as nc_psd is discarded at fn exit. */
732 if (security_info_sent
& OWNER_SECURITY_INFORMATION
) {
733 nc_psd
->owner_sid
= psd
->owner_sid
;
735 security_info_sent
|= OWNER_SECURITY_INFORMATION
;
737 if (security_info_sent
& GROUP_SECURITY_INFORMATION
) {
738 nc_psd
->group_sid
= psd
->group_sid
;
740 security_info_sent
|= GROUP_SECURITY_INFORMATION
;
742 if (security_info_sent
& DACL_SECURITY_INFORMATION
) {
743 nc_psd
->dacl
= dup_sec_acl(talloc_tos(), psd
->dacl
);
744 if (nc_psd
->dacl
== NULL
) {
745 return NT_STATUS_NO_MEMORY
;
748 security_info_sent
|= DACL_SECURITY_INFORMATION
;
752 status
= SMB_VFS_NEXT_FSET_NT_ACL(handle
, fsp
, security_info_sent
, psd
);
753 if (!NT_STATUS_IS_OK(status
)) {
757 /* Get the full underlying sd, then hash. */
758 status
= SMB_VFS_NEXT_FGET_NT_ACL(handle
,
763 if (!NT_STATUS_IS_OK(status
)) {
767 status
= hash_sd_sha256(pdesc_next
, hash
);
768 if (!NT_STATUS_IS_OK(status
)) {
772 if (DEBUGLEVEL
>= 10) {
773 DEBUG(10,("fset_nt_acl_xattr: storing xattr sd for file %s\n",
775 NDR_PRINT_DEBUG(security_descriptor
,
776 CONST_DISCARD(struct security_descriptor
*,psd
));
778 create_acl_blob(psd
, &blob
, XATTR_SD_HASH_TYPE_SHA256
, hash
);
779 store_acl_blob_fsp(handle
, fsp
, &blob
);
784 static SMB_STRUCT_DIR
*opendir_acl_common(vfs_handle_struct
*handle
,
785 const char *fname
, const char *mask
, uint32 attr
)
787 NTSTATUS status
= check_parent_acl_common(handle
, fname
, SEC_DIR_LIST
);
789 if (!NT_STATUS_IS_OK(status
)) {
790 errno
= map_errno_from_nt_status(status
);
793 return SMB_VFS_NEXT_OPENDIR(handle
, fname
, mask
, attr
);