]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: gluster: vfs_gluster_create_dfs_pathat() isn't restricted to dirfsp->conn...
authorJeremy Allison <jra@samba.org>
Wed, 17 Mar 2021 04:48:42 +0000 (21:48 -0700)
committerNoel Power <npower@samba.org>
Mon, 22 Mar 2021 18:37:34 +0000 (18:37 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
source3/modules/vfs_glusterfs.c

index 38c8a48c378712e70aa708a4b54dbb9490cd9bc3..cb83e0124244fc05dd3b58341d26b02368ecdf27 100644 (file)
@@ -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 {