From: Stefan Metzmacher Date: Mon, 15 Aug 2022 07:45:43 +0000 (+0200) Subject: s3:smbd: lease_match_break_fn() only needs leases_db_get() once X-Git-Tag: talloc-2.4.0~1390 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=60ae7a5a2ed9a03d8693b9b455b7b3696386aeb1;p=thirdparty%2Fsamba.git s3:smbd: lease_match_break_fn() only needs leases_db_get() once get_lease_type() will just call leases_db_get() again... BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125 Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 5eea89d69c8..0cb56c7830b 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -5491,7 +5491,7 @@ static bool lease_match_break_fn( { struct lease_match_break_state *state = private_data; bool stale, equal; - uint32_t e_lease_type; + uint32_t e_lease_type = SMB2_LEASE_NONE; NTSTATUS status; stale = share_entry_stale_pid(e); @@ -5508,7 +5508,7 @@ static bool lease_match_break_fn( &e->client_guid, &e->lease_key, &state->id, - NULL, /* current_state */ + &e_lease_type, /* current_state */ NULL, /* breaking */ NULL, /* breaking_to_requested */ NULL, /* breaking_to_required */ @@ -5519,9 +5519,9 @@ static bool lease_match_break_fn( } else { DBG_WARNING("Could not find version/epoch: %s\n", nt_errstr(status)); + return false; } - e_lease_type = get_lease_type(e, state->id); if (e_lease_type == SMB2_LEASE_NONE) { return false; }