s3: smbd: Tweak openat_pathref_dirfsp_nosymlink() to NULL out fsp->fsp_name after...
authorJeremy Allison <jra@samba.org>
Thu, 12 Jan 2023 19:20:08 +0000 (11:20 -0800)
committerVolker Lendecke <vl@samba.org>
Fri, 13 Jan 2023 08:33:47 +0000 (08:33 +0000)
vfs_virusfilter expects a non-NULL fsp->fsp_name to use for printing debugs
(it always indirects fsp->fsp_name). vfs_fruit also does the same, so would
also crash in fruit_close() with 'debug level = 10' and vfs_default:VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS = no
set (we don't test with that which is why we haven't noticed
this before).

Remove knownfail.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15283

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jan 13 08:33:47 UTC 2023 on sn-devel-184

selftest/knownfail.d/virusscanner [deleted file]
source3/smbd/files.c

diff --git a/selftest/knownfail.d/virusscanner b/selftest/knownfail.d/virusscanner
deleted file mode 100644 (file)
index 9bcaae7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.blackbox.virus_scanner.check_infected_read\(fileserver:local\)
index 87684b1984d57c07aa1c16e5f8905adcaec9186f..792e9424bdce592fb2b59287b4850a1a635ac4a2 100644 (file)
@@ -1058,9 +1058,9 @@ next:
        }
 
        if (dirfsp != conn->cwd_fsp) {
-               dirfsp->fsp_name = NULL;
                SMB_ASSERT(fsp_get_pathref_fd(dirfsp) != -1);
                fd_close(dirfsp);
+               dirfsp->fsp_name = NULL;
                file_free(NULL, dirfsp);
                dirfsp = NULL;
        }
@@ -1122,9 +1122,9 @@ fail:
        }
 
        if ((dirfsp != NULL) && (dirfsp != conn->cwd_fsp)) {
-               dirfsp->fsp_name = NULL;
                SMB_ASSERT(fsp_get_pathref_fd(dirfsp) != -1);
                fd_close(dirfsp);
+               dirfsp->fsp_name = NULL;
                file_free(NULL, dirfsp);
                dirfsp = NULL;
        }