]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: fix for bug 14375
authorRalph Boehme <slow@samba.org>
Sat, 9 May 2020 13:13:54 +0000 (15:13 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 12 May 2020 18:15:31 +0000 (18:15 +0000)
... with many thanks to an enthusiastic Samba user from Poland for helping to
track this down.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
selftest/knownfail.d/smb2.sharemode [deleted file]
source3/smbd/open.c

diff --git a/selftest/knownfail.d/smb2.sharemode b/selftest/knownfail.d/smb2.sharemode
deleted file mode 100644 (file)
index 12061ab..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.smb2.sharemode.bug14375.*$
index 98fa1a872038a7956be81be25040535d64ad8367..cc71cce4df48eeca1f53fc71e4725609da54ebb1 100644 (file)
@@ -1755,7 +1755,9 @@ static uint16_t share_mode_flags_restrict(
                &existing_lease_type);
 
        existing_access_mask |= access_mask;
-       existing_share_mode &= share_mode;
+       if (access_mask & conflicting_access) {
+               existing_share_mode &= share_mode;
+       }
        existing_lease_type |= lease_type;
 
        ret = share_mode_flags_set(
@@ -1794,7 +1796,10 @@ static bool open_mode_check_fn(
        }
 
        access_mask = state->access_mask | e->access_mask;
-       share_access = state->share_access & e->share_access;
+       share_access = state->share_access;
+       if (e->access_mask & conflicting_access) {
+               share_access &= e->share_access;
+       }
        lease_type = state->lease_type | get_lease_type(e, state->fid);
 
        if ((access_mask == state->access_mask) &&