From: Ralph Boehme Date: Wed, 20 Jan 2021 14:22:16 +0000 (+0100) Subject: vfs_virusfilter: support real dirfsps in virusfilter_vfs_unlinkat() X-Git-Tag: tevent-0.11.0~1920 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39f432ac5d5d672a7cc5bc8097b00ae92c9bbe61;p=thirdparty%2Fsamba.git vfs_virusfilter: support real dirfsps in virusfilter_vfs_unlinkat() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_virusfilter.c b/source3/modules/vfs_virusfilter.c index 290d9a23335..e0712b99b42 100644 --- a/source3/modules/vfs_virusfilter.c +++ b/source3/modules/vfs_virusfilter.c @@ -1511,8 +1511,9 @@ static int virusfilter_vfs_unlinkat(struct vfs_handle_struct *handle, smb_fname, flags); struct virusfilter_config *config = NULL; + struct smb_filename *full_fname = NULL; char *fname = NULL; - char *cwd_fname = handle->conn->cwd_fsp->fsp_name->base_name; + char *cwd_fname = dirfsp->fsp_name->base_name; if (ret != 0 && errno != ENOENT) { return ret; @@ -1525,11 +1526,19 @@ static int virusfilter_vfs_unlinkat(struct vfs_handle_struct *handle, return 0; } - fname = smb_fname->base_name; + full_fname = full_path_from_dirfsp_atname(talloc_tos(), + dirfsp, + smb_fname); + if (full_fname == NULL) { + return -1; + } + + fname = full_fname->base_name; DBG_DEBUG("Removing cache entry (if existent): fname: %s\n", fname); virusfilter_cache_remove(config->cache, cwd_fname, fname); + TALLOC_FREE(full_fname); return 0; }