summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2020-12-14 11:51:20 +0100
committerJeremy Allison <jra@samba.org>2020-12-17 18:56:29 +0000
commitb54158fb72d5008c0cf639c9d24501a010885ef1 (patch)
tree7878a5741f128bbe6e992ab78ccffa1d9de4090b /source3/modules
parent1af5892a9851389b9eba978c4c70cc67392dce0e (diff)
downloadsamba-b54158fb72d5008c0cf639c9d24501a010885ef1.tar.gz
smbd: move mode logic out of vfswrap_mkdirat() to the caller mkdir_internal()
This is the correct place where this code should be. It also means opaque VFS modules that implement their own mkdirat() like glusterfs now use this logic. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_ceph.c14
-rw-r--r--source3/modules/vfs_default.c14
2 files changed, 0 insertions, 28 deletions
diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index 4c380c3ad20..ee5d1caa793 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -365,26 +365,12 @@ static int cephwrap_mkdirat(struct vfs_handle_struct *handle,
mode_t mode)
{
int result;
- struct smb_filename *parent = NULL;
- bool ok;
DBG_DEBUG("[CEPH] mkdir(%p, %s)\n",
handle, smb_fname_str_dbg(smb_fname));
SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);
- if (lp_inherit_acls(SNUM(handle->conn))) {
- ok = parent_smb_fname(talloc_tos(), smb_fname, &parent, NULL);
- if (ok && directory_has_default_acl(handle->conn,
- dirfsp,
- parent))
- {
- mode = 0777;
- }
- }
-
- TALLOC_FREE(parent);
-
result = ceph_mkdir(handle->data, smb_fname->base_name, mode);
return WRAP_RETURN(result);
}
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index df52856cd1e..4aaafedac56 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -670,25 +670,11 @@ static int vfswrap_mkdirat(vfs_handle_struct *handle,
mode_t mode)
{
int result;
- struct smb_filename *parent = NULL;
- bool ok;
START_PROFILE(syscall_mkdirat);
SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);
- if (lp_inherit_acls(SNUM(handle->conn))) {
- ok = parent_smb_fname(talloc_tos(), smb_fname, &parent, NULL);
- if (ok && directory_has_default_acl(handle->conn,
- dirfsp,
- parent))
- {
- mode = (0777 & lp_directory_mask(SNUM(handle->conn)));
- }
- }
-
- TALLOC_FREE(parent);
-
result = mkdirat(fsp_get_pathref_fd(dirfsp), smb_fname->base_name, mode);
END_PROFILE(syscall_mkdirat);