From: Ralph Boehme Date: Fri, 28 Nov 2025 11:12:52 +0000 (+0100) Subject: smbd: restrict pure R leases on directories on CA shares X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bcb806490703630fdc97c3e8730d391cb889f383;p=thirdparty%2Fsamba.git smbd: restrict pure R leases on directories on CA shares Signed-off-by: Ralph Boehme Reviewed-by: Anoop C S --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index cac28775030..8ba54553aad 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2683,6 +2683,17 @@ grant: * ignores the SMB2_LEASE_WRITE bit. */ granted &= ~SMB2_LEASE_WRITE; + if (fsp->conn->tcon->capabilities & + SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY) + { + /* + * Windows doesn't grant "pure" R leases in SO mode on + * directories, we apply this restriction in CA mode. As + * we also don't grant H leases in CA mode, set granted + * to 0. + */ + granted = 0; + } } if (oplock_request == LEASE_OPLOCK) {