1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s3:smbd: only store durable handles with byte range locks when having WRITE lease

This simplifies the reconnect assumptions, when we want to allow
more than one durable handle on a file for multiple clients with
READ+HANDLE leases.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15649
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15651

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 0893ae8818)
This commit is contained in:
Stefan Metzmacher 2024-08-30 18:10:16 +02:00 committed by Jule Anger
parent ad0fb08546
commit 041f15c8a8
2 changed files with 6 additions and 2 deletions

View File

@ -1,2 +0,0 @@
^samba3.smb2.durable-open.lock-noW-lease
^samba3.smb2.durable-v2-open.lock-noW-lease

View File

@ -173,6 +173,12 @@ NTSTATUS vfs_default_durable_disconnect(struct files_struct *fsp,
return NT_STATUS_NOT_SUPPORTED;
}
if (fsp->current_lock_count != 0 &&
(fsp_lease_type(fsp) & SMB2_LEASE_WRITE) == 0)
{
return NT_STATUS_NOT_SUPPORTED;
}
/*
* For now let it be simple and do not keep
* delete on close files durable open