1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3: VFS: glusterfs: Fix vfs_gluster_readlinkat() to cope with real directory fsps.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
This commit is contained in:
Jeremy Allison 2021-02-11 11:02:28 -08:00
parent b500162b01
commit 2786a564e6

View File

@ -1876,11 +1876,23 @@ static int vfs_gluster_readlinkat(struct vfs_handle_struct *handle,
char *buf,
size_t bufsiz)
{
struct smb_filename *full_fname = NULL;
int ret;
START_PROFILE(syscall_readlinkat);
SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);
ret = glfs_readlink(handle->data, smb_fname->base_name, buf, bufsiz);
full_fname = full_path_from_dirfsp_atname(talloc_tos(),
dirfsp,
smb_fname);
if (full_fname == NULL) {
END_PROFILE(syscall_readlinkat);
return -1;
}
ret = glfs_readlink(handle->data, full_fname->base_name, buf, bufsiz);
TALLOC_FREE(full_fname);
END_PROFILE(syscall_readlinkat);
return ret;