From: Ralph Boehme Date: Sat, 9 May 2020 13:13:54 +0000 (+0200) Subject: smbd: fix for bug 14375 X-Git-Tag: ldb-2.2.0~552 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59f55aa083ce2d87ad6f43dc941f725c79c8ec59;p=thirdparty%2Fsamba.git smbd: fix for bug 14375 ... 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 Reviewed-by: Volker Lendecke --- diff --git a/selftest/knownfail.d/smb2.sharemode b/selftest/knownfail.d/smb2.sharemode deleted file mode 100644 index 12061ab7f23..00000000000 --- a/selftest/knownfail.d/smb2.sharemode +++ /dev/null @@ -1 +0,0 @@ -^samba3.smb2.sharemode.bug14375.*$ diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 98fa1a87203..cc71cce4df4 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -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) &&