]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:auth/ntlm: simplifiy logic in name_to_ntstatus_check_password()
authorStefan Metzmacher <metze@samba.org>
Wed, 29 Jan 2025 08:52:37 +0000 (09:52 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 14 Feb 2025 14:21:33 +0000 (14:21 +0000)
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 <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
source4/auth/ntlm/auth_developer.c

index 89db15d0ee7c353566ab2f48dc764591ea8fda59..19ea7b5fbc78aa1446899dfc5b291c60262bea06 100644 (file)
@@ -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! */