From: Ralph Boehme Date: Wed, 16 Dec 2020 14:37:02 +0000 (+0100) Subject: vfs_acl_common: add an fsp extension when setting ACL X-Git-Tag: samba-4.14.0rc1~184 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6b0797caff1e292cec3bee245ee63e58702efb8;p=thirdparty%2Fsamba.git vfs_acl_common: add an fsp extension when setting ACL This allows the module checking for the fsp extension variable setting_nt_acl and will be used in the module functions for .sys_acl_set_fd_fn (so sys_acl_set_fd_xattr() and sys_acl_set_fd_tdb()). This depends on the previous code changes, so won't be back ported. But for reference the bug id is below. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14592 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c index 06f751e4387..5aeb159b686 100644 --- a/source3/modules/vfs_acl_common.c +++ b/source3/modules/vfs_acl_common.c @@ -1034,6 +1034,7 @@ NTSTATUS fset_nt_acl_common( TALLOC_CTX *frame = talloc_stackframe(); bool ignore_file_system_acl = lp_parm_bool( SNUM(handle->conn), module_name, "ignore system acls", false); + struct acl_common_fsp_ext *ext = NULL; if (DEBUGLEVEL >= 10) { DBG_DEBUG("incoming sd for file %s\n", fsp_str_dbg(fsp)); @@ -1090,6 +1091,12 @@ NTSTATUS fset_nt_acl_common( psd->type |= SEC_DESC_SACL_PRESENT; } + ext = VFS_ADD_FSP_EXTENSION(handle, + fsp, + struct acl_common_fsp_ext, + NULL); + ext->setting_nt_acl = true; + if (ignore_file_system_acl) { if (chown_needed) { /* send only ownership stuff to lower layer */ @@ -1174,6 +1181,7 @@ NTSTATUS fset_nt_acl_common( status = store_acl_blob_fsp_fn(handle, fsp, &blob); done: + VFS_REMOVE_FSP_EXTENSION(handle, fsp); TALLOC_FREE(frame); return status; } diff --git a/source3/modules/vfs_acl_common.h b/source3/modules/vfs_acl_common.h index c84448b9f15..c686395bdfa 100644 --- a/source3/modules/vfs_acl_common.h +++ b/source3/modules/vfs_acl_common.h @@ -29,6 +29,10 @@ struct acl_common_config { enum default_acl_style default_acl_style; }; +struct acl_common_fsp_ext { + bool setting_nt_acl; +}; + bool init_acl_common_config(vfs_handle_struct *handle, const char *module_name);