From: Jeremy Allison Date: Wed, 17 Mar 2021 04:48:42 +0000 (-0700) Subject: s3: VFS: gluster: vfs_gluster_create_dfs_pathat() isn't restricted to dirfsp->conn... X-Git-Tag: tevent-0.11.0~1438 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ea5c15358f12a6cd584b52039411e0feb526f380;p=thirdparty%2Fsamba.git s3: VFS: gluster: vfs_gluster_create_dfs_pathat() isn't restricted to dirfsp->conn->cwd_fsp anymore. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c index 38c8a48c378..cb83e012424 100644 --- a/source3/modules/vfs_glusterfs.c +++ b/source3/modules/vfs_glusterfs.c @@ -2130,8 +2130,14 @@ static NTSTATUS vfs_gluster_create_dfs_pathat(struct vfs_handle_struct *handle, NTSTATUS status = NT_STATUS_NO_MEMORY; int ret; char *msdfs_link = NULL; + struct smb_filename *full_fname = NULL; - SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp); + full_fname = full_path_from_dirfsp_atname(talloc_tos(), + dirfsp, + smb_fname); + if (full_fname == NULL) { + goto out; + } /* Form the msdfs_link contents */ msdfs_link = msdfs_link_string(frame, @@ -2143,7 +2149,7 @@ static NTSTATUS vfs_gluster_create_dfs_pathat(struct vfs_handle_struct *handle, ret = glfs_symlink(handle->data, msdfs_link, - smb_fname->base_name); + full_fname->base_name); if (ret == 0) { status = NT_STATUS_OK; } else {