smbd: fix has_other_nonposix_opens_fn()
authorRalph Boehme <slow@samba.org>
Fri, 13 Oct 2023 08:54:44 +0000 (10:54 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 13 Nov 2023 19:34:29 +0000 (19:34 +0000)
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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Nov 13 19:34:29 UTC 2023 on atb-devel-224

selftest/knownfail.d/samba.tests.smb3unix.samba.tests.smb3unix.Smb3UnixTests [deleted file]
source3/smbd/close.c

diff --git a/selftest/knownfail.d/samba.tests.smb3unix.samba.tests.smb3unix.Smb3UnixTests b/selftest/knownfail.d/samba.tests.smb3unix.samba.tests.smb3unix.Smb3UnixTests
deleted file mode 100644 (file)
index e893a35..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba.tests.smb3unix.samba.tests.smb3unix.Smb3UnixTests.test_delete_on_close\(fileserver_smb1\)
index ad451ecd1e6a90e89c1528e96c41df469f8041b3..f1f5e41a43fa296dac82aed9db01c71d787ca952 100644 (file)
@@ -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)) {