From: Ralph Boehme Date: Thu, 6 Nov 2025 13:40:41 +0000 (+0100) Subject: smbd: adjust get_lease_type() for Persistent Handles X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93da8eb02cf1c2ece6fe7084a46fa31c9129a680;p=thirdparty%2Fsamba.git smbd: adjust get_lease_type() for Persistent Handles If the lease record was lost due to a node outage, just return SMB2_LEASE_NONE. Note that e->protect will only be set to true for Persistent Handles and if the handle is currently disconnected. Signed-off-by: Ralph Boehme Reviewed-by: Anoop C S --- diff --git a/source3/smbd/smb2_oplock.c b/source3/smbd/smb2_oplock.c index e518333905c..2489090af55 100644 --- a/source3/smbd/smb2_oplock.c +++ b/source3/smbd/smb2_oplock.c @@ -218,6 +218,9 @@ uint32_t get_lease_type(struct share_mode_entry *e, struct file_id id) if (share_entry_stale_pid(e)) { return SMB2_LEASE_NONE; } + if (e->protect) { + return SMB2_LEASE_NONE; + } DBG_ERR("leases_db_get for client_guid [%s] " "lease_key [%"PRIx64"/%"PRIx64"] " "file_id [%s] failed: %s\n",