1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

vfs_ceph: use parent_smb_fname()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Ralph Boehme 2020-04-28 14:41:21 +02:00 committed by Jeremy Allison
parent 7f68944acd
commit 8bd6908bae

View File

@ -355,22 +355,26 @@ static int cephwrap_mkdirat(struct vfs_handle_struct *handle,
mode_t mode)
{
int result;
char *parent = NULL;
const char *path = smb_fname->base_name;
struct smb_filename *parent = NULL;
bool ok;
DBG_DEBUG("[CEPH] mkdir(%p, %s)\n", handle, path);
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))
&& parent_dirname(talloc_tos(), path, &parent, NULL)
&& directory_has_default_acl(handle->conn, parent)) {
mode = 0777;
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,
parent->base_name))
{
mode = 0777;
}
}
TALLOC_FREE(parent);
result = ceph_mkdir(handle->data, path, mode);
result = ceph_mkdir(handle->data, smb_fname->base_name, mode);
return WRAP_RETURN(result);
}