Bug 15933 - Only increment lease epoch if a lease was granted
Summary: Only increment lease epoch if a lease was granted
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Jule Anger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-10 10:36 UTC by Ralph Böhme
Modified: 2025-11-07 13:24 UTC (History)
1 user (show)

See Also:


Attachments
Patch for 4.22 and 4.23 cherry-picked from master (6.54 KB, patch)
2025-10-14 09:42 UTC, Ralph Böhme
vl: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Böhme 2025-10-10 10:36:57 UTC
The lease epoch should not be incremented by the server from the value sent by the client in the request if a lease was not granted ie lease_level=NONE.

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.

Have patch, need bugnumber.
Comment 1 Samba QA Contact 2025-10-10 17:03:03 UTC
This bug was referenced in samba master:

ca0363e5a7f53cde4ae7223c36f21c2ae12318f9
9f45eae2928bd2cb46fc827a348531acb471a549
Comment 2 Ralph Böhme 2025-10-14 09:42:54 UTC
Created attachment 18757 [details]
Patch for 4.22 and 4.23 cherry-picked from master
Comment 3 Jule Anger 2025-10-15 13:40:48 UTC
Pushed to autobuild-v4-{23,22}-test.
Comment 4 Samba QA Contact 2025-10-15 15:11:28 UTC
This bug was referenced in samba v4-23-test:

1757b5ae5ae96bb9b5fb444aa2efe0d752e940f4
6d2cf012b41cddc53df63b1ca80a8b378c0bfadb
Comment 5 Samba QA Contact 2025-10-15 16:05:28 UTC
This bug was referenced in samba v4-22-test:

966700ae2be12fd7048e1865f5ac69887f7dc223
a5d457827fafcdc39f295937536601f482686e90
Comment 6 Jule Anger 2025-10-15 16:36:17 UTC
Closing out bug report.

Thanks!
Comment 7 Samba QA Contact 2025-10-16 14:37:20 UTC
This bug was referenced in samba v4-22-stable (Release samba-4.22.6):

966700ae2be12fd7048e1865f5ac69887f7dc223
a5d457827fafcdc39f295937536601f482686e90
Comment 8 Samba QA Contact 2025-11-07 13:24:15 UTC
This bug was referenced in samba v4-23-stable (Release samba-4.23.3):

1757b5ae5ae96bb9b5fb444aa2efe0d752e940f4
6d2cf012b41cddc53df63b1ca80a8b378c0bfadb