From d50bb46038b4d2c81b2e9623c5b678206856bccd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 17 May 2018 11:18:12 -0700 Subject: [PATCH] s3: modules: vfs_ceph: Remove CHMOD_ACL in cephwrap_mkdir(). Now I understand the use of the mask in POSIX ACLs this extra step is no longer needed. Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- source3/modules/vfs_ceph.c | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index bac88581133..f3b651b894e 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -368,7 +368,6 @@ static int cephwrap_mkdir(struct vfs_handle_struct *handle, mode_t mode) { int result; - bool has_dacl = False; char *parent = NULL; const char *path = smb_fname->base_name; @@ -376,34 +375,14 @@ static int cephwrap_mkdir(struct vfs_handle_struct *handle, if (lp_inherit_acls(SNUM(handle->conn)) && parent_dirname(talloc_tos(), path, &parent, NULL) - && (has_dacl = directory_has_default_acl(handle->conn, parent))) + && directory_has_default_acl(handle->conn, parent)) { mode = 0777; + } TALLOC_FREE(parent); result = ceph_mkdir(handle->data, path, mode); - - /* - * Note. This order is important - */ - if (result) { - WRAP_RETURN(result); - } else if (result == 0 && !has_dacl) { - /* - * We need to do this as the default behavior of POSIX ACLs - * is to set the mask to be the requested group permission - * bits, not the group permission bits to be the requested - * group permission bits. This is not what we want, as it will - * mess up any inherited ACL bits that were set. JRA. - */ - int saved_errno = errno; /* We may get ENOSYS */ - if ((SMB_VFS_CHMOD_ACL(handle->conn, smb_fname, mode) == -1) && - (errno == ENOSYS)) { - errno = saved_errno; - } - } - - return result; + return WRAP_RETURN(result); } static int cephwrap_rmdir(struct vfs_handle_struct *handle, -- 2.47.2