From 551f85464bbd6275a1d645a06089f4c7db55b866 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 13 Sep 2018 18:56:54 +0200 Subject: [PATCH] smbd: Add a paranoia check for leases Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- source3/smbd/oplock.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index 2faad788d46..827dbeb4ef2 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -347,6 +347,12 @@ static void lease_timeout_handler(struct tevent_context *ctx, return; } + /* + * Paranoia check: There can only be one fsp_lease per lease + * key + */ + SMB_ASSERT(fsp->lease == lease); + lck = get_existing_share_mode_lock( talloc_tos(), fsp->file_id); if (lck == NULL) {