mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
vfs_virusfilter: support real dirfsps in virusfilter_vfs_unlinkat()
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
2d31aef937
commit
39f432ac5d
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user