From: Volker Lendecke Date: Fri, 9 Feb 2024 11:37:53 +0000 (+0100) Subject: smbd: Simplify an if-condition X-Git-Tag: tdb-1.4.11~896 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=647d2c6481c07da70a87116089a4a42b72adbdb1;p=thirdparty%2Fsamba.git smbd: Simplify an if-condition (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 Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/smbXsrv_session.c b/source3/smbd/smbXsrv_session.c index 5d407e0256d..36f39c68a14 100644 --- a/source3/smbd/smbXsrv_session.c +++ b/source3/smbd/smbXsrv_session.c @@ -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 = ¤t_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 = ¤t_token->sids[PRIMARY_USER_SID_INDEX]; if (!security_token_has_nt_authenticated_users(current_token)) { /* TODO */