From: Ralph Boehme Date: Fri, 19 Jun 2026 12:01:01 +0000 (+0200) Subject: vfs_default: check for missing lease create context X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d2d5029266b1cbf376f109dabdde3fed7e41717e;p=thirdparty%2Fsamba.git vfs_default: check for missing lease create context MS-SMB2: 3.3.5.9.7 Handling the SMB2_CREATE_DURABLE_HANDLE_RECONNECT Create Context tells us: ... If any of the following conditions is TRUE, the server MUST fail the request with STATUS_OBJECT_NAME_NOT_FOUND: - Open.Lease is not NULL and the SMB2_CREATE_REQUEST_LEASE_V2 or the SMB2_CREATE_REQUEST_LEASE create context is not present. ... Signed-off-by: Ralph Boehme Reviewed-by: Anoop C S --- diff --git a/source3/smbd/durable.c b/source3/smbd/durable.c index b4821e56970..c4409d6d524 100644 --- a/source3/smbd/durable.c +++ b/source3/smbd/durable.c @@ -691,6 +691,17 @@ static void vfs_default_durable_reconnect_fn(struct share_mode_lock *lck, goto fail; } + if ((e.op_type == LEASE_OPLOCK) && (state->lease == NULL)) { + /* + * The client didn't send a lease context when reconnecting, + * although the handle did have a lease. + */ + DBG_WARNING("Trying to reconnect handle with lease without lease context on [%s]\n", + fsp_str_dbg(fsp)); + state->status = NT_STATUS_OBJECT_NAME_NOT_FOUND; + goto fail; + } + fsp_apply_share_entry_flags(fsp, e.flags); fsp->open_time = e.time; fsp->access_mask = e.access_mask;