From: Jeremy Allison Date: Fri, 15 Jan 2021 22:33:17 +0000 (-0800) Subject: s3: VFS: ceph: Fix cephwrap_symlinkat() to cope with real directory fsps. X-Git-Tag: samba-4.14.0rc1~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8e8ea23097df7b1c1c596f8dd99ab2a59afe3a4;p=thirdparty%2Fsamba.git s3: VFS: ceph: Fix cephwrap_symlinkat() 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 b2d9ead1db5..cacc725310a 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -1052,16 +1052,24 @@ static int cephwrap_symlinkat(struct vfs_handle_struct *handle, struct files_struct *dirfsp, const struct smb_filename *new_smb_fname) { + struct smb_filename *full_fname = NULL; int result = -1; + + full_fname = full_path_from_dirfsp_atname(talloc_tos(), + dirfsp, + new_smb_fname); + if (full_fname == NULL) { + return -1; + } + DBG_DEBUG("[CEPH] symlink(%p, %s, %s)\n", handle, link_target->base_name, - new_smb_fname->base_name); - - SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp); + full_fname->base_name); result = ceph_symlink(handle->data, link_target->base_name, - new_smb_fname->base_name); + full_fname->base_name); + TALLOC_FREE(full_fname); DBG_DEBUG("[CEPH] symlink(...) = %d\n", result); WRAP_RETURN(result); }