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" <trever.adams@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Mon Mar 22 19:44:30 UTC 2021 on sn-devel-184
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);
goto virusfilter_vfs_open_next;
}
- ret = SMB_VFS_NEXT_STAT(handle, smb_fname);
+ ret = SMB_VFS_NEXT_FSTAT(handle, fsp, &sbuf);
if (ret != 0) {
/*