diff options
author | Jeremy Allison <jra@samba.org> | 2021-01-15 14:33:17 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2021-01-17 04:43:31 +0000 |
commit | c8e8ea23097df7b1c1c596f8dd99ab2a59afe3a4 (patch) | |
tree | b754d5d76bdae8aec74748b2f06158f377cbb8b1 | |
parent | b96c2cf0199495b32dbdce5c833a0b64a9c4bd5d (diff) | |
download | samba-c8e8ea23097df7b1c1c596f8dd99ab2a59afe3a4.tar.gz |
s3: VFS: ceph: Fix cephwrap_symlinkat() to cope with real directory fsps.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
-rw-r--r-- | source3/modules/vfs_ceph.c | 16 |
1 files changed, 12 insertions, 4 deletions
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); } |