From 2fd3e4184a6e1c4b317e4dfec2e0af65452cd3a9 Mon Sep 17 00:00:00 2001 From: "Trever L. Adams" Date: Sat, 13 Mar 2021 12:47:21 -0700 Subject: [PATCH] s3:modules:vfs_virusfilter: Recent New_VFS changes break vfs_virusfilter_openat. The_New_VFS introduces several changes that broke vfs_virusfilter_openat. The assert to make sure certain checks would work broke. This patch fixes those breaks and converts to the SMB_VFS_FSTAT_NEXT instead of SMB_VFS_STAT_NEXT. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14671 RN: vfs_virusfilter_openat support New_VFS FSTAT, avoid SMB_ASSERT(fsp_get_pathref_fd(dirfsp) == AT_FDCWD); problem. Signed-off-by: Trever L. Adams" Reviewed-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Mon Mar 22 19:44:30 UTC 2021 on sn-devel-184 (cherry picked from commit d6a16ad00e426a6f815215af71c071dd8e85a50a) --- source3/modules/vfs_virusfilter.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/source3/modules/vfs_virusfilter.c b/source3/modules/vfs_virusfilter.c index c9f5e2bf908..524e7dfbad9 100644 --- a/source3/modules/vfs_virusfilter.c +++ b/source3/modules/vfs_virusfilter.c @@ -1238,11 +1238,7 @@ static int virusfilter_vfs_openat(struct vfs_handle_struct *handle, bool ok1; char *sret = NULL; struct smb_filename *smb_fname = NULL; - - /* - * For now assert this, so SMB_VFS_NEXT_STAT() below works. - */ - SMB_ASSERT(fsp_get_pathref_fd(dirfsp) == AT_FDCWD); + SMB_STRUCT_STAT sbuf = smb_fname_in->st; SMB_VFS_HANDLE_GET_DATA(handle, config, struct virusfilter_config, return -1); @@ -1284,7 +1280,7 @@ static int virusfilter_vfs_openat(struct vfs_handle_struct *handle, goto virusfilter_vfs_open_next; } - ret = SMB_VFS_NEXT_STAT(handle, smb_fname); + ret = SMB_VFS_NEXT_FSTAT(handle, fsp, &sbuf); if (ret != 0) { /* -- 2.27.0