From d75095ee770ce97c53252a90d51614e16485df4b Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 13 Oct 2023 10:54:44 +0200 Subject: [PATCH] smbd: fix has_other_nonposix_opens_fn() Given two opens on a file: 1. Windows open with delete-on-close 2. POSIX open with delete-on-close set When handle 1 is closed processing in has_other_nonposix_opens_fn() will not delete the file as (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) is false, so has_other_nonposix_opens() will return true which is wrong. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15517 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Mon Nov 13 19:34:29 UTC 2023 on atb-devel-224 (cherry picked from commit 95443320847967ea6412e59b5b7d3853fffe588a) --- source3/smbd/close.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source3/smbd/close.c b/source3/smbd/close.c index af5e78daa100..9a939db254e3 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -241,8 +241,7 @@ static bool has_other_nonposix_opens_fn( if (e->name_hash != fsp->name_hash) { return false; } - if ((fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) && - (e->flags & SHARE_MODE_FLAG_POSIX_OPEN)) { + if (e->flags & SHARE_MODE_FLAG_POSIX_OPEN) { return false; } if (e->share_file_id == fh_get_gen_id(fsp->fh)) { -- 2.41.0