From: Jeremy Allison Date: Thu, 14 Jan 2021 20:31:24 +0000 (-0800) Subject: s3: VFS: ceph: Fix cephwrap_mkdirat() to cope with real directory fsps. X-Git-Tag: samba-4.14.0rc1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8291c13f820f008a99df77394cb75fffd6add589;p=thirdparty%2Fsamba.git s3: VFS: ceph: Fix cephwrap_mkdirat() to cope with real directory fsps. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index 6bb770005e1..ed5cf50e7b2 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -364,14 +364,23 @@ static int cephwrap_mkdirat(struct vfs_handle_struct *handle, const struct smb_filename *smb_fname, mode_t mode) { + struct smb_filename *full_fname = NULL; int result; + full_fname = full_path_from_dirfsp_atname(talloc_tos(), + dirfsp, + smb_fname); + if (full_fname == NULL) { + return -1; + } + DBG_DEBUG("[CEPH] mkdir(%p, %s)\n", - handle, smb_fname_str_dbg(smb_fname)); + handle, smb_fname_str_dbg(full_fname)); - SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp); + result = ceph_mkdir(handle->data, full_fname->base_name, mode); + + TALLOC_FREE(full_fname); - result = ceph_mkdir(handle->data, smb_fname->base_name, mode); return WRAP_RETURN(result); }