From: Jeremy Allison Date: Thu, 14 Jan 2021 20:25:24 +0000 (-0800) Subject: s3: VFS: glusterfs: Fix vfs_gluster_mknodat() to cope with a real dirfsp. X-Git-Tag: samba-4.14.0rc1~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=30af87f46f91b3175d51908b8c77e6ee178145f3;p=thirdparty%2Fsamba.git s3: VFS: glusterfs: Fix vfs_gluster_mknodat() 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 68a428ed3f3..59b76546112 100644 --- a/source3/modules/vfs_glusterfs.c +++ b/source3/modules/vfs_glusterfs.c @@ -1900,11 +1900,23 @@ static int vfs_gluster_mknodat(struct vfs_handle_struct *handle, mode_t mode, SMB_DEV_T dev) { + struct smb_filename *full_fname = NULL; int ret; START_PROFILE(syscall_mknodat); - SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp); - ret = glfs_mknod(handle->data, smb_fname->base_name, mode, dev); + + full_fname = full_path_from_dirfsp_atname(talloc_tos(), + dirfsp, + smb_fname); + if (full_fname == NULL) { + END_PROFILE(syscall_mknodat); + return -1; + } + + ret = glfs_mknod(handle->data, full_fname->base_name, mode, dev); + + TALLOC_FREE(full_fname); + END_PROFILE(syscall_mknodat); return ret;