From MS-SMB2 3.3.5.9.11 "Handling the SMB2_CREATE_REQUEST_LEASE_V2 Create
Context":
If the object store succeeds this request, Lease.LeaseState MUST be set to the
new caching state. The server MUST increment Lease.Epoch by 1.
try_lease_upgrade() already has the same logic when checking for a possible
upgrade of an exisiting lease.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15933
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Oct 10 17:02:26 UTC 2025 on atb-devel-224
(cherry picked from commit
9f45eae2928bd2cb46fc827a348531acb471a549)
Autobuild-User(v4-23-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-23-test): Wed Oct 15 15:10:19 UTC 2025 on atb-devel-224
+++ /dev/null
-^samba3.smb2.lease.lease-epoch\(fileserver\)
fsp->lease->lease.parent_lease_key = lease->parent_lease_key;
fsp->lease->lease.lease_flags = lease->lease_flags;
fsp->lease->lease.lease_state = granted;
- fsp->lease->lease.lease_epoch = lease->lease_epoch + 1;
+ fsp->lease->lease.lease_epoch = lease->lease_epoch;
+ if (granted != 0) {
+ fsp->lease->lease.lease_epoch++;
+ }
status = leases_db_add(client_guid,
&lease->lease_key,