]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: adjust get_lease_type() for Persistent Handles
authorRalph Boehme <slow@samba.org>
Thu, 6 Nov 2025 13:40:41 +0000 (14:40 +0100)
committerRalph Boehme <slow@samba.org>
Fri, 17 Jul 2026 10:18:37 +0000 (10:18 +0000)
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 <slow@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/smbd/smb2_oplock.c

index e518333905c391a6d64e109d5fc52bb3e7f4c3c0..2489090af55c79be9e9940616d1591f5139a8942 100644 (file)
@@ -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",