summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2018-05-17 11:03:53 -0700
committerJeremy Allison <jra@samba.org>2018-05-25 18:39:24 +0200
commit90117f25bf10ea47f1bc02c22dc41f2a560d57eb (patch)
tree9d8c81f92770e498a17c6612caa0acf00a00a458
parentaaed6b4e995bb95fdc3ca6e768e84d14b3a3e446 (diff)
downloadsamba-90117f25bf10ea47f1bc02c22dc41f2a560d57eb.tar.gz
s3: modules: vfs_default: Remove CHMOD_ACL in mkdir.
Now I understand the use of the mask in POSIX ACLs this extra step is no longer needed. If the mkdir succeeded it's already set the correct mode. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
-rw-r--r--source3/modules/vfs_default.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index e335e270650..956cebfd592 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -498,7 +498,6 @@ static int vfswrap_mkdir(vfs_handle_struct *handle,
mode_t mode)
{
int result;
- bool has_dacl = False;
const char *path = smb_fname->base_name;
char *parent = NULL;
@@ -506,7 +505,7 @@ static int vfswrap_mkdir(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 & lp_directory_mask(SNUM(handle->conn)));
}
@@ -514,21 +513,6 @@ static int vfswrap_mkdir(vfs_handle_struct *handle,
result = mkdir(path, mode);
- 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;
- }
- }
-
END_PROFILE(syscall_mkdir);
return result;
}