From: Jeremy Allison Date: Fri, 15 Jan 2021 22:35:58 +0000 (-0800) Subject: s3: VFS: glusterfs: Fix vfs_gluster_symlinkat() to cope with a real dirfsp. X-Git-Tag: samba-4.14.0rc1~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=35f2c7641e6235fdad492f47b0685e89016a9cb1;p=thirdparty%2Fsamba.git s3: VFS: glusterfs: Fix vfs_gluster_symlinkat() to cope with a real dirfsp. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c index 59b76546112..9cc27b5c352 100644 --- a/source3/modules/vfs_glusterfs.c +++ b/source3/modules/vfs_glusterfs.c @@ -1844,13 +1844,25 @@ static int vfs_gluster_symlinkat(struct vfs_handle_struct *handle, struct files_struct *dirfsp, const struct smb_filename *new_smb_fname) { + struct smb_filename *full_fname = NULL; int ret; START_PROFILE(syscall_symlinkat); - SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp); + + full_fname = full_path_from_dirfsp_atname(talloc_tos(), + dirfsp, + new_smb_fname); + if (full_fname == NULL) { + END_PROFILE(syscall_symlinkat); + return -1; + } + ret = glfs_symlink(handle->data, link_target->base_name, - new_smb_fname->base_name); + full_fname->base_name); + + TALLOC_FREE(full_fname); + END_PROFILE(syscall_symlinkat); return ret;