From: Ralph Boehme Date: Wed, 20 Jan 2021 14:02:28 +0000 (+0100) Subject: vfs_glusterfs: support real dirfsps in vfs_gluster_unlinkat() X-Git-Tag: tevent-0.11.0~1939 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=613ca5a7eee53256b81b3dee243ad205693cae47;p=thirdparty%2Fsamba.git vfs_glusterfs: support real dirfsps in vfs_gluster_unlinkat() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c index 36459bc3184..25ff945f5f1 100644 --- a/source3/modules/vfs_glusterfs.c +++ b/source3/modules/vfs_glusterfs.c @@ -1434,15 +1434,25 @@ static int vfs_gluster_unlinkat(struct vfs_handle_struct *handle, const struct smb_filename *smb_fname, int flags) { + struct smb_filename *full_fname = NULL; int ret; START_PROFILE(syscall_unlinkat); - SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp); + + full_fname = full_path_from_dirfsp_atname(talloc_tos(), + dirfsp, + smb_fname); + if (full_fname == NULL) { + END_PROFILE(syscall_unlinkat); + return -1; + } + if (flags & AT_REMOVEDIR) { - ret = glfs_rmdir(handle->data, smb_fname->base_name); + ret = glfs_rmdir(handle->data, full_fname->base_name); } else { - ret = glfs_unlink(handle->data, smb_fname->base_name); + ret = glfs_unlink(handle->data, full_fname->base_name); } + TALLOC_FREE(full_fname); END_PROFILE(syscall_unlinkat); return ret;