]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: lease_match_break_fn() only needs leases_db_get() once
authorStefan Metzmacher <metze@samba.org>
Mon, 15 Aug 2022 07:45:43 +0000 (09:45 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 19 Aug 2022 18:41:34 +0000 (18:41 +0000)
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 <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/open.c

index 5eea89d69c8dfbd4ecbe406ac9fbd86c070fea83..0cb56c7830b3d992d2342488b9757444ff85c1a5 100644 (file)
@@ -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;
        }