From: Ralph Boehme Date: Thu, 5 Mar 2020 14:16:07 +0000 (+0100) Subject: smbd: use is_lease_stat_open() in delay_for_oplock() X-Git-Tag: ldb-2.2.0~787 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62621bd686a91328ae378cd56f9876c66be8eac4;p=thirdparty%2Fsamba.git smbd: use is_lease_stat_open() in delay_for_oplock() This allows READ_CONTROL_ACCESS in the access mask as stat open if a file has only leases. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14357 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Thu Apr 30 21:10:43 UTC 2020 on sn-devel-184 --- diff --git a/selftest/knownfail.d/samba3.smb2.lease b/selftest/knownfail.d/samba3.smb2.lease deleted file mode 100644 index 079d4438b8c..00000000000 --- a/selftest/knownfail.d/samba3.smb2.lease +++ /dev/null @@ -1 +0,0 @@ -^samba3.smb2.lease.statopen4\(nt4_dc\) diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 3cd8f156ab6..8383fe1df5c 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2371,6 +2371,10 @@ static bool delay_for_oplock_fn( state->have_other_lease = true; } + if (e_is_lease && is_lease_stat_open(fsp->access_mask)) { + return false; + } + break_to = e_lease_type & ~state->delay_mask; if (state->will_overwrite) {