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 #include "smbd/smbd.h"
23 #include "system/filesys.h"
24 #include "../libcli/security/security.h"
25 #include "../librpc/gen_ndr/ndr_security.h"
26 #include "../lib/util/bitmap.h"
28 static NTSTATUS
create_acl_blob(const struct security_descriptor
*psd
,
31 uint8_t hash
[XATTR_SD_HASH_SIZE
]);
33 static NTSTATUS
get_acl_blob(TALLOC_CTX
*ctx
,
34 vfs_handle_struct
*handle
,
39 static NTSTATUS
store_acl_blob_fsp(vfs_handle_struct
*handle
,
43 #define HASH_SECURITY_INFO (SECINFO_OWNER | \
48 /*******************************************************************
49 Hash a security descriptor.
50 *******************************************************************/
52 static NTSTATUS
hash_sd_sha256(struct security_descriptor
*psd
,
59 memset(hash
, '\0', XATTR_SD_HASH_SIZE
);
60 status
= create_acl_blob(psd
, &blob
, XATTR_SD_HASH_TYPE_SHA256
, hash
);
61 if (!NT_STATUS_IS_OK(status
)) {
65 samba_SHA256_Init(&tctx
);
66 samba_SHA256_Update(&tctx
, blob
.data
, blob
.length
);
67 samba_SHA256_Final(hash
, &tctx
);
72 /*******************************************************************
73 Parse out a struct security_descriptor from a DATA_BLOB.
74 *******************************************************************/
76 static NTSTATUS
parse_acl_blob(const DATA_BLOB
*pblob
,
78 struct security_descriptor
**ppdesc
,
79 uint16_t *p_hash_type
,
80 uint8_t hash
[XATTR_SD_HASH_SIZE
])
82 struct xattr_NTACL xacl
;
83 enum ndr_err_code ndr_err
;
85 TALLOC_CTX
*frame
= talloc_stackframe();
87 ndr_err
= ndr_pull_struct_blob(pblob
, frame
, &xacl
,
88 (ndr_pull_flags_fn_t
)ndr_pull_xattr_NTACL
);
90 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err
)) {
91 DEBUG(5, ("parse_acl_blob: ndr_pull_xattr_NTACL failed: %s\n",
92 ndr_errstr(ndr_err
)));
94 return ndr_map_error2ntstatus(ndr_err
);
97 switch (xacl
.version
) {
99 *ppdesc
= make_sec_desc(mem_ctx
, SD_REVISION
,
100 xacl
.info
.sd
->type
| SEC_DESC_SELF_RELATIVE
,
101 xacl
.info
.sd
->owner_sid
,
102 xacl
.info
.sd
->group_sid
,
106 /* No hash - null out. */
107 *p_hash_type
= XATTR_SD_HASH_TYPE_NONE
;
108 memset(hash
, '\0', XATTR_SD_HASH_SIZE
);
111 *ppdesc
= make_sec_desc(mem_ctx
, SD_REVISION
,
112 xacl
.info
.sd_hs2
->sd
->type
| SEC_DESC_SELF_RELATIVE
,
113 xacl
.info
.sd_hs2
->sd
->owner_sid
,
114 xacl
.info
.sd_hs2
->sd
->group_sid
,
115 xacl
.info
.sd_hs2
->sd
->sacl
,
116 xacl
.info
.sd_hs2
->sd
->dacl
,
118 /* No hash - null out. */
119 *p_hash_type
= XATTR_SD_HASH_TYPE_NONE
;
120 memset(hash
, '\0', XATTR_SD_HASH_SIZE
);
123 *ppdesc
= make_sec_desc(mem_ctx
, SD_REVISION
,
124 xacl
.info
.sd_hs3
->sd
->type
| SEC_DESC_SELF_RELATIVE
,
125 xacl
.info
.sd_hs3
->sd
->owner_sid
,
126 xacl
.info
.sd_hs3
->sd
->group_sid
,
127 xacl
.info
.sd_hs3
->sd
->sacl
,
128 xacl
.info
.sd_hs3
->sd
->dacl
,
130 *p_hash_type
= xacl
.info
.sd_hs3
->hash_type
;
131 /* Current version 3. */
132 memcpy(hash
, xacl
.info
.sd_hs3
->hash
, XATTR_SD_HASH_SIZE
);
136 return NT_STATUS_REVISION_MISMATCH
;
141 return (*ppdesc
!= NULL
) ? NT_STATUS_OK
: NT_STATUS_NO_MEMORY
;
144 /*******************************************************************
145 Create a DATA_BLOB from a security descriptor.
146 *******************************************************************/
148 static NTSTATUS
create_acl_blob(const struct security_descriptor
*psd
,
151 uint8_t hash
[XATTR_SD_HASH_SIZE
])
153 struct xattr_NTACL xacl
;
154 struct security_descriptor_hash_v3 sd_hs3
;
155 enum ndr_err_code ndr_err
;
156 TALLOC_CTX
*ctx
= talloc_tos();
162 xacl
.info
.sd_hs3
= &sd_hs3
;
163 xacl
.info
.sd_hs3
->sd
= discard_const_p(struct security_descriptor
, psd
);
164 xacl
.info
.sd_hs3
->hash_type
= hash_type
;
165 memcpy(&xacl
.info
.sd_hs3
->hash
[0], hash
, XATTR_SD_HASH_SIZE
);
167 ndr_err
= ndr_push_struct_blob(
169 (ndr_push_flags_fn_t
)ndr_push_xattr_NTACL
);
171 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err
)) {
172 DEBUG(5, ("create_acl_blob: ndr_push_xattr_NTACL failed: %s\n",
173 ndr_errstr(ndr_err
)));
174 return ndr_map_error2ntstatus(ndr_err
);
180 /*******************************************************************
181 Add in 3 inheritable components for a non-inheritable directory ACL.
182 CREATOR_OWNER/CREATOR_GROUP/WORLD.
183 *******************************************************************/
185 static NTSTATUS
add_directory_inheritable_components(vfs_handle_struct
*handle
,
187 SMB_STRUCT_STAT
*psbuf
,
188 struct security_descriptor
*psd
)
190 struct connection_struct
*conn
= handle
->conn
;
191 int num_aces
= (psd
->dacl
? psd
->dacl
->num_aces
: 0);
192 struct smb_filename smb_fname
;
193 enum security_ace_type acltype
;
194 uint32_t access_mask
;
198 struct security_ace
*new_ace_list
= talloc_zero_array(talloc_tos(),
202 if (new_ace_list
== NULL
) {
203 return NT_STATUS_NO_MEMORY
;
206 /* Fake a quick smb_filename. */
207 ZERO_STRUCT(smb_fname
);
208 smb_fname
.st
= *psbuf
;
209 smb_fname
.base_name
= discard_const_p(char, name
);
211 dir_mode
= unix_mode(conn
,
212 FILE_ATTRIBUTE_DIRECTORY
, &smb_fname
, NULL
);
213 file_mode
= unix_mode(conn
,
214 FILE_ATTRIBUTE_ARCHIVE
, &smb_fname
, NULL
);
216 mode
= dir_mode
| file_mode
;
218 DEBUG(10, ("add_directory_inheritable_components: directory %s, "
221 (unsigned int)mode
));
224 memcpy(new_ace_list
, psd
->dacl
->aces
,
225 num_aces
* sizeof(struct security_ace
));
227 access_mask
= map_canon_ace_perms(SNUM(conn
), &acltype
,
230 init_sec_ace(&new_ace_list
[num_aces
],
231 &global_sid_Creator_Owner
,
234 SEC_ACE_FLAG_CONTAINER_INHERIT
|
235 SEC_ACE_FLAG_OBJECT_INHERIT
|
236 SEC_ACE_FLAG_INHERIT_ONLY
);
237 access_mask
= map_canon_ace_perms(SNUM(conn
), &acltype
,
238 (mode
<< 3) & 0700, false);
239 init_sec_ace(&new_ace_list
[num_aces
+1],
240 &global_sid_Creator_Group
,
243 SEC_ACE_FLAG_CONTAINER_INHERIT
|
244 SEC_ACE_FLAG_OBJECT_INHERIT
|
245 SEC_ACE_FLAG_INHERIT_ONLY
);
246 access_mask
= map_canon_ace_perms(SNUM(conn
), &acltype
,
247 (mode
<< 6) & 0700, false);
248 init_sec_ace(&new_ace_list
[num_aces
+2],
252 SEC_ACE_FLAG_CONTAINER_INHERIT
|
253 SEC_ACE_FLAG_OBJECT_INHERIT
|
254 SEC_ACE_FLAG_INHERIT_ONLY
);
256 psd
->dacl
->aces
= new_ace_list
;
257 psd
->dacl
->num_aces
+= 3;
259 psd
->dacl
= make_sec_acl(talloc_tos(),
263 if (psd
->dacl
== NULL
) {
264 return NT_STATUS_NO_MEMORY
;
270 /*******************************************************************
271 Pull a DATA_BLOB from an xattr given a pathname.
272 If the hash doesn't match, or doesn't exist - return the underlying
274 *******************************************************************/
276 static NTSTATUS
get_nt_acl_internal(vfs_handle_struct
*handle
,
279 uint32_t security_info
,
281 struct security_descriptor
**ppdesc
)
283 DATA_BLOB blob
= data_blob_null
;
285 uint16_t hash_type
= XATTR_SD_HASH_TYPE_NONE
;
286 uint8_t hash
[XATTR_SD_HASH_SIZE
];
287 uint8_t hash_tmp
[XATTR_SD_HASH_SIZE
];
288 struct security_descriptor
*psd
= NULL
;
289 struct security_descriptor
*pdesc_next
= NULL
;
290 bool ignore_file_system_acl
= lp_parm_bool(SNUM(handle
->conn
),
292 "ignore system acls",
295 if (fsp
&& name
== NULL
) {
296 name
= fsp
->fsp_name
->base_name
;
299 DEBUG(10, ("get_nt_acl_internal: name=%s\n", name
));
301 /* Get the full underlying sd for the hash
302 or to return as backup. */
304 status
= SMB_VFS_NEXT_FGET_NT_ACL(handle
,
310 status
= SMB_VFS_NEXT_GET_NT_ACL(handle
,
317 if (!NT_STATUS_IS_OK(status
)) {
318 DEBUG(10, ("get_nt_acl_internal: get_next_acl for file %s "
325 status
= get_acl_blob(talloc_tos(), handle
, fsp
, name
, &blob
);
326 if (!NT_STATUS_IS_OK(status
)) {
327 DEBUG(10, ("get_nt_acl_internal: get_acl_blob returned %s\n",
333 status
= parse_acl_blob(&blob
, mem_ctx
, &psd
,
334 &hash_type
, &hash
[0]);
335 if (!NT_STATUS_IS_OK(status
)) {
336 DEBUG(10, ("parse_acl_blob returned %s\n",
342 /* Ensure the hash type is one we know. */
344 case XATTR_SD_HASH_TYPE_NONE
:
345 /* No hash, just return blob sd. */
347 case XATTR_SD_HASH_TYPE_SHA256
:
350 DEBUG(10, ("get_nt_acl_internal: ACL blob revision "
351 "mismatch (%u) for file %s\n",
352 (unsigned int)hash_type
,
359 if (ignore_file_system_acl
) {
363 status
= hash_sd_sha256(pdesc_next
, hash_tmp
);
364 if (!NT_STATUS_IS_OK(status
)) {
370 if (memcmp(&hash
[0], &hash_tmp
[0], XATTR_SD_HASH_SIZE
) == 0) {
371 /* Hash matches, return blob sd. */
372 DEBUG(10, ("get_nt_acl_internal: blob hash "
373 "matches for file %s\n",
378 /* Hash doesn't match, return underlying sd. */
379 DEBUG(10, ("get_nt_acl_internal: blob hash "
380 "does not match for file %s - returning "
381 "file system SD mapping.\n",
384 if (DEBUGLEVEL
>= 10) {
385 DEBUG(10,("get_nt_acl_internal: acl for blob hash for %s is:\n",
387 NDR_PRINT_DEBUG(security_descriptor
, pdesc_next
);
395 if (psd
!= pdesc_next
) {
396 /* We're returning the blob, throw
397 * away the filesystem SD. */
398 TALLOC_FREE(pdesc_next
);
400 SMB_STRUCT_STAT sbuf
;
401 SMB_STRUCT_STAT
*psbuf
= &sbuf
;
402 bool is_directory
= false;
404 * We're returning the underlying ACL from the
405 * filesystem. If it's a directory, and has no
406 * inheritable ACE entries we have to fake them.
409 status
= vfs_stat_fsp(fsp
);
410 if (!NT_STATUS_IS_OK(status
)) {
413 psbuf
= &fsp
->fsp_name
->st
;
415 int ret
= vfs_stat_smb_fname(handle
->conn
,
419 return map_nt_error_from_unix(errno
);
422 is_directory
= S_ISDIR(psbuf
->st_ex_mode
);
424 if (ignore_file_system_acl
) {
425 TALLOC_FREE(pdesc_next
);
426 status
= make_default_filesystem_acl(mem_ctx
,
430 if (!NT_STATUS_IS_OK(status
)) {
435 !sd_has_inheritable_components(psd
,
437 status
= add_directory_inheritable_components(
442 if (!NT_STATUS_IS_OK(status
)) {
446 /* The underlying POSIX module always sets
447 the ~SEC_DESC_DACL_PROTECTED bit, as ACLs
448 can't be inherited in this way under POSIX.
449 Remove it for Windows-style ACLs. */
450 psd
->type
&= ~SEC_DESC_DACL_PROTECTED
;
454 if (!(security_info
& SECINFO_OWNER
)) {
455 psd
->owner_sid
= NULL
;
457 if (!(security_info
& SECINFO_GROUP
)) {
458 psd
->group_sid
= NULL
;
460 if (!(security_info
& SECINFO_DACL
)) {
461 psd
->type
&= ~SEC_DESC_DACL_PRESENT
;
464 if (!(security_info
& SECINFO_SACL
)) {
465 psd
->type
&= ~SEC_DESC_SACL_PRESENT
;
469 TALLOC_FREE(blob
.data
);
472 if (DEBUGLEVEL
>= 10) {
473 DEBUG(10,("get_nt_acl_internal: returning acl for %s is:\n",
475 NDR_PRINT_DEBUG(security_descriptor
, psd
);
481 /*********************************************************************
482 Fetch a security descriptor given an fsp.
483 *********************************************************************/
485 static NTSTATUS
fget_nt_acl_common(vfs_handle_struct
*handle
,
487 uint32_t security_info
,
489 struct security_descriptor
**ppdesc
)
491 return get_nt_acl_internal(handle
, fsp
,
492 NULL
, security_info
, mem_ctx
, ppdesc
);
495 /*********************************************************************
496 Fetch a security descriptor given a pathname.
497 *********************************************************************/
499 static NTSTATUS
get_nt_acl_common(vfs_handle_struct
*handle
,
501 uint32_t security_info
,
503 struct security_descriptor
**ppdesc
)
505 return get_nt_acl_internal(handle
, NULL
,
506 name
, security_info
, mem_ctx
, ppdesc
);
509 /*********************************************************************
510 Store a security descriptor given an fsp.
511 *********************************************************************/
513 static NTSTATUS
fset_nt_acl_common(vfs_handle_struct
*handle
, files_struct
*fsp
,
514 uint32_t security_info_sent
, const struct security_descriptor
*orig_psd
)
518 struct security_descriptor
*pdesc_next
= NULL
;
519 struct security_descriptor
*psd
= NULL
;
520 uint8_t hash
[XATTR_SD_HASH_SIZE
];
521 bool chown_needed
= false;
522 TALLOC_CTX
*frame
= talloc_stackframe();
524 if (DEBUGLEVEL
>= 10) {
525 DEBUG(10,("fset_nt_acl_xattr: incoming sd for file %s\n",
527 NDR_PRINT_DEBUG(security_descriptor
,
528 discard_const_p(struct security_descriptor
, orig_psd
));
531 status
= get_nt_acl_internal(handle
, fsp
,
533 SECINFO_OWNER
|SECINFO_GROUP
|SECINFO_DACL
|SECINFO_SACL
,
537 if (!NT_STATUS_IS_OK(status
)) {
542 psd
->revision
= orig_psd
->revision
;
543 /* All our SD's are self relative. */
544 psd
->type
= orig_psd
->type
| SEC_DESC_SELF_RELATIVE
;
546 if ((security_info_sent
& SECINFO_OWNER
) && (orig_psd
->owner_sid
!= NULL
)) {
547 if (!dom_sid_equal(orig_psd
->owner_sid
, psd
->owner_sid
)) {
548 /* We're changing the owner. */
551 psd
->owner_sid
= orig_psd
->owner_sid
;
553 if ((security_info_sent
& SECINFO_GROUP
) && (orig_psd
->group_sid
!= NULL
)) {
554 if (!dom_sid_equal(orig_psd
->group_sid
, psd
->group_sid
)) {
555 /* We're changing the group. */
558 psd
->group_sid
= orig_psd
->group_sid
;
560 if (security_info_sent
& SECINFO_DACL
) {
561 psd
->dacl
= orig_psd
->dacl
;
562 psd
->type
|= SEC_DESC_DACL_PRESENT
;
564 if (security_info_sent
& SECINFO_SACL
) {
565 psd
->sacl
= orig_psd
->sacl
;
566 psd
->type
|= SEC_DESC_SACL_PRESENT
;
569 status
= SMB_VFS_NEXT_FSET_NT_ACL(handle
, fsp
, security_info_sent
, psd
);
570 if (!NT_STATUS_IS_OK(status
)) {
571 if (!NT_STATUS_EQUAL(status
, NT_STATUS_ACCESS_DENIED
)) {
575 /* We got access denied here. If we're already root,
576 or we didn't need to do a chown, or the fsp isn't
577 open with WRITE_OWNER access, just return. */
578 if (get_current_uid(handle
->conn
) == 0 ||
579 chown_needed
== false ||
580 !(fsp
->access_mask
& SEC_STD_WRITE_OWNER
)) {
581 return NT_STATUS_ACCESS_DENIED
;
584 DEBUG(10,("fset_nt_acl_common: overriding chown on file %s "
587 sid_string_tos(psd
->owner_sid
)
590 /* Ok, we failed to chown and we have
591 SEC_STD_WRITE_OWNER access - override. */
593 status
= SMB_VFS_NEXT_FSET_NT_ACL(handle
, fsp
,
594 security_info_sent
, psd
);
596 if (!NT_STATUS_IS_OK(status
)) {
602 /* Get the full underlying sd, then hash. */
603 status
= SMB_VFS_NEXT_FGET_NT_ACL(handle
,
609 if (!NT_STATUS_IS_OK(status
)) {
614 status
= hash_sd_sha256(pdesc_next
, hash
);
615 if (!NT_STATUS_IS_OK(status
)) {
620 if (DEBUGLEVEL
>= 10) {
621 DEBUG(10,("fset_nt_acl_xattr: storing xattr sd for file %s\n",
623 NDR_PRINT_DEBUG(security_descriptor
,
624 discard_const_p(struct security_descriptor
, psd
));
626 DEBUG(10,("fset_nt_acl_xattr: storing has in xattr sd based on \n"));
627 NDR_PRINT_DEBUG(security_descriptor
,
628 discard_const_p(struct security_descriptor
, pdesc_next
));
630 status
= create_acl_blob(psd
, &blob
, XATTR_SD_HASH_TYPE_SHA256
, hash
);
631 if (!NT_STATUS_IS_OK(status
)) {
632 DEBUG(10, ("fset_nt_acl_xattr: create_acl_blob failed\n"));
637 status
= store_acl_blob_fsp(handle
, fsp
, &blob
);
643 static int acl_common_remove_object(vfs_handle_struct
*handle
,
647 connection_struct
*conn
= handle
->conn
;
649 files_struct
*fsp
= NULL
;
651 char *parent_dir
= NULL
;
652 const char *final_component
= NULL
;
653 struct smb_filename local_fname
;
655 char *saved_dir
= NULL
;
657 saved_dir
= vfs_GetWd(talloc_tos(),conn
);
663 if (!parent_dirname(talloc_tos(), path
,
664 &parent_dir
, &final_component
)) {
665 saved_errno
= ENOMEM
;
669 DEBUG(10,("acl_common_remove_object: removing %s %s/%s\n",
670 is_directory
? "directory" : "file",
671 parent_dir
, final_component
));
673 /* cd into the parent dir to pin it. */
674 ret
= vfs_ChDir(conn
, parent_dir
);
680 ZERO_STRUCT(local_fname
);
681 local_fname
.base_name
= discard_const_p(char, final_component
);
683 /* Must use lstat here. */
684 ret
= SMB_VFS_LSTAT(conn
, &local_fname
);
690 /* Ensure we have this file open with DELETE access. */
691 id
= vfs_file_id_from_sbuf(conn
, &local_fname
.st
);
692 for (fsp
= file_find_di_first(conn
->sconn
, id
); fsp
;
693 fsp
= file_find_di_next(fsp
)) {
694 if (fsp
->access_mask
& DELETE_ACCESS
&&
695 fsp
->delete_on_close
) {
696 /* We did open this for delete,
697 * allow the delete as root.
704 DEBUG(10,("acl_common_remove_object: %s %s/%s "
705 "not an open file\n",
706 is_directory
? "directory" : "file",
707 parent_dir
, final_component
));
708 saved_errno
= EACCES
;
714 ret
= SMB_VFS_NEXT_RMDIR(handle
, final_component
);
716 ret
= SMB_VFS_NEXT_UNLINK(handle
, &local_fname
);
726 TALLOC_FREE(parent_dir
);
729 vfs_ChDir(conn
, saved_dir
);
737 static int rmdir_acl_common(struct vfs_handle_struct
*handle
,
742 /* Try the normal rmdir first. */
743 ret
= SMB_VFS_NEXT_RMDIR(handle
, path
);
747 if (errno
== EACCES
|| errno
== EPERM
) {
748 /* Failed due to access denied,
749 see if we need to root override. */
750 return acl_common_remove_object(handle
,
755 DEBUG(10,("rmdir_acl_common: unlink of %s failed %s\n",
761 static int unlink_acl_common(struct vfs_handle_struct
*handle
,
762 const struct smb_filename
*smb_fname
)
766 /* Try the normal unlink first. */
767 ret
= SMB_VFS_NEXT_UNLINK(handle
, smb_fname
);
771 if (errno
== EACCES
|| errno
== EPERM
) {
772 /* Failed due to access denied,
773 see if we need to root override. */
775 /* Don't do anything fancy for streams. */
776 if (smb_fname
->stream_name
) {
779 return acl_common_remove_object(handle
,
780 smb_fname
->base_name
,
784 DEBUG(10,("unlink_acl_common: unlink of %s failed %s\n",
785 smb_fname
->base_name
,
790 static int chmod_acl_module_common(struct vfs_handle_struct
*handle
,
791 const char *path
, mode_t mode
)
793 if (lp_posix_pathnames()) {
794 /* Only allow this on POSIX pathnames. */
795 return SMB_VFS_NEXT_CHMOD(handle
, path
, mode
);
800 static int fchmod_acl_module_common(struct vfs_handle_struct
*handle
,
801 struct files_struct
*fsp
, mode_t mode
)
803 if (fsp
->posix_open
) {
804 /* Only allow this on POSIX opens. */
805 return SMB_VFS_NEXT_FCHMOD(handle
, fsp
, mode
);
810 static int chmod_acl_acl_module_common(struct vfs_handle_struct
*handle
,
811 const char *name
, mode_t mode
)
813 if (lp_posix_pathnames()) {
814 /* Only allow this on POSIX pathnames. */
815 return SMB_VFS_NEXT_CHMOD_ACL(handle
, name
, mode
);
820 static int fchmod_acl_acl_module_common(struct vfs_handle_struct
*handle
,
821 struct files_struct
*fsp
, mode_t mode
)
823 if (fsp
->posix_open
) {
824 /* Only allow this on POSIX opens. */
825 return SMB_VFS_NEXT_FCHMOD_ACL(handle
, fsp
, mode
);