summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2023-01-12 11:20:08 -0800
committerVolker Lendecke <vl@samba.org>2023-01-13 08:33:47 +0000
commit3d3d01cda8d3a6d0d18d1b808aa9414e71d56062 (patch)
tree060fd66ee06dc3484c454a501e67ea3d1f365c60
parentc844bff3eca336547c6cedfeeb03adda4eed57c6 (diff)
downloadsamba-3d3d01cda8d3a6d0d18d1b808aa9414e71d56062.tar.gz
s3: smbd: Tweak openat_pathref_dirfsp_nosymlink() to NULL out fsp->fsp_name after calling fd_close() on intermediate directories, rather than before.
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
-rw-r--r--selftest/knownfail.d/virusscanner1
-rw-r--r--source3/smbd/files.c4
2 files changed, 2 insertions, 3 deletions
diff --git a/selftest/knownfail.d/virusscanner b/selftest/knownfail.d/virusscanner
deleted file mode 100644
index 9bcaae7b4d1..00000000000
--- a/selftest/knownfail.d/virusscanner
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.blackbox.virus_scanner.check_infected_read\(fileserver:local\)
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index 87684b1984d..792e9424bdc 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -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;
}