Bug 15894 - Server grants invalid lease level H
Summary: Server grants invalid lease level H
Status: ASSIGNED
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: Ralph Böhme
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-09 10:57 UTC by Ralph Böhme
Modified: 2025-08-15 16:52 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Böhme 2025-08-09 10:57:31 UTC
When determining which lease level to grant, we check for byterange locks on the file and if there are any, we remove R from the requested lease level. If the client requested RH, we remove R leaving H which is invalid according to MS-SMB2.

Have patch, need bugnumber.
Comment 1 Ralph Böhme 2025-08-09 11:05:31 UTC
There are two more minor issues. These are not bugs, we're just returning or breaking to more restrictive lease levels then necessary when compared against Windows server:

1. When truncating a file which has byterange locks to size 0, the client can be granted RH leases. We currently never grant any lease in this case.

2. When a contending open causes a sharing violation, we break not just a H Lease (if any), but also R and W leases.
Comment 2 Samba QA Contact 2025-08-15 16:52:03 UTC
This bug was referenced in samba master:

9eba1a1423be253216ea862029cee2398961f7d4
196efe52814a24cd4a8c47346226407af17eadbd
f26ae02a1bf739f25975143d1e1706d30ff98b2f
0fdd231f80eb9afe783e065c50b0f93c813d0857
debcd77ae7818ec953058e7524642ef76e0e6c7b
1fcc1500eedf4c08d1245c8c71d8002e32d8e40f
215b2c741a93023d13e8a9f82739ac3e91b64a66
b2f7a1c7623248b3a42a0ba3e07ab523403d9f9b
65d86082338c0b46358520ba5134b3f9c39291ee