]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Simplify an if-condition
authorVolker Lendecke <vl@samba.org>
Fri, 9 Feb 2024 11:37:53 +0000 (12:37 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 30 Apr 2024 22:44:32 +0000 (22:44 +0000)
(state->current_sid == NULL) is true if and only if we could not
assign state->current_sid because num_sids was too small. Make that
more explicit.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/smbXsrv_session.c

index 5d407e0256d7b95e1586f71ae5d0291bb476cc4a..36f39c68a14fa7b7d109e1defd4fa7867765ac0c 100644 (file)
@@ -1040,14 +1040,11 @@ struct tevent_req *smb2srv_session_close_previous_send(TALLOC_CTX *mem_ctx,
        }
        current_token = session_info->security_token;
 
-       if (current_token->num_sids > PRIMARY_USER_SID_INDEX) {
-               state->current_sid = &current_token->sids[PRIMARY_USER_SID_INDEX];
-       }
-
-       if (state->current_sid == NULL) {
+       if (current_token->num_sids <= PRIMARY_USER_SID_INDEX) {
                tevent_req_done(req);
                return tevent_req_post(req, ev);
        }
+       state->current_sid = &current_token->sids[PRIMARY_USER_SID_INDEX];
 
        if (!security_token_has_nt_authenticated_users(current_token)) {
                /* TODO */