From: Jeremy Allison Date: Wed, 17 Mar 2021 04:48:07 +0000 (-0700) Subject: s3: VFS: ceph: cephwrap_create_dfs_pathat() isn't restricted to dirfsp->conn->cwd_fsp... X-Git-Tag: tevent-0.11.0~1439 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c344ade717853b2622602d2f1fa38d073ffc2810;p=thirdparty%2Fsamba.git s3: VFS: ceph: cephwrap_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_ceph.c b/source3/modules/vfs_ceph.c index e2f3691bc4f..e371090c95d 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -1379,8 +1379,14 @@ static NTSTATUS cephwrap_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, @@ -1392,7 +1398,7 @@ static NTSTATUS cephwrap_create_dfs_pathat(struct vfs_handle_struct *handle, ret = ceph_symlink(handle->data, msdfs_link, - smb_fname->base_name); + full_fname->base_name); if (ret == 0) { status = NT_STATUS_OK; } else { @@ -1402,7 +1408,7 @@ static NTSTATUS cephwrap_create_dfs_pathat(struct vfs_handle_struct *handle, out: DBG_DEBUG("[CEPH] create_dfs_pathat(%s) = %s\n", - smb_fname->base_name, + full_fname->base_name, nt_errstr(status)); TALLOC_FREE(frame);