From: Stefan Metzmacher Date: Wed, 29 Jan 2025 08:52:37 +0000 (+0100) Subject: s4:auth/ntlm: simplifiy logic in name_to_ntstatus_check_password() X-Git-Tag: tevent-0.17.0~781 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=068413a17a53376ae63f12cb44b91462420d4665;p=thirdparty%2Fsamba.git s4:auth/ntlm: simplifiy logic in name_to_ntstatus_check_password() Using (struct auth_SidAttr) {} means we won't leave uninitialized memory arround if struct auth_SidAttr will change in the following commits. Signed-off-by: Stefan Metzmacher Reviewed-by: Jennifer Sutton --- diff --git a/source4/auth/ntlm/auth_developer.c b/source4/auth/ntlm/auth_developer.c index 89db15d0ee7..19ea7b5fbc7 100644 --- a/source4/auth/ntlm/auth_developer.c +++ b/source4/auth/ntlm/auth_developer.c @@ -85,8 +85,10 @@ static NTSTATUS name_to_ntstatus_check_password(struct auth_method_context *ctx, user_info_dc->sids = talloc(user_info_dc, struct auth_SidAttr); NT_STATUS_HAVE_NO_MEMORY(user_info_dc->sids); - user_info_dc->sids->sid = global_sid_Anonymous; - user_info_dc->sids->attrs = SE_GROUP_DEFAULT_FLAGS; + user_info_dc->sids[0] = (struct auth_SidAttr) { + .sid = global_sid_Anonymous, + .attrs = SE_GROUP_DEFAULT_FLAGS, + }; /* annoying, but the Anonymous really does have a session key, and it is all zeros! */