From: Volker Lendecke Date: Tue, 6 Aug 2019 08:45:27 +0000 (+0200) Subject: smbd: Clean up leases.tdb if set_share_mode() fails X-Git-Tag: tdb-1.4.2~284 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbc367595418dee16333f3334381a226d37d4e25;p=thirdparty%2Fsamba.git smbd: Clean up leases.tdb if set_share_mode() fails Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 01f62223ddb..d70ea8b5a5d 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2354,6 +2354,17 @@ static NTSTATUS grant_fsp_oplock_type(struct smb_request *req, share_access, access_mask); if (!ok) { + if (fsp->oplock_type == LEASE_OPLOCK) { + status = remove_lease_if_stale( + lck->data, + fsp_client_guid(fsp), + &fsp->lease->lease.lease_key); + if (!NT_STATUS_IS_OK(status)) { + DBG_WARNING("remove_lease_if_stale " + "failed: %s\n", + nt_errstr(status)); + } + } return NT_STATUS_NO_MEMORY; }