]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: ceph: Fix cephwrap_mkdirat() to cope with real directory fsps.
authorJeremy Allison <jra@samba.org>
Thu, 14 Jan 2021 20:31:24 +0000 (12:31 -0800)
committerJeremy Allison <jra@samba.org>
Fri, 15 Jan 2021 20:56:28 +0000 (20:56 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_ceph.c

index 6bb770005e15ed1afcaae0dd6bc2fbcc0a9fe36b..ed5cf50e7b2461c3c334e7ecc2995c589efdfaab 100644 (file)
@@ -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);
 }