]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:auth: simplify auth_anonymous_user_info_dc()
authorStefan Metzmacher <metze@samba.org>
Wed, 29 Jan 2025 10:34:42 +0000 (11:34 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 14 Feb 2025 14:21:33 +0000 (14:21 +0000)
By using (struct auth_SidAttr) {} we don't leave
uninitialized memory if struct auth_SidAttr changes.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
source4/auth/system_session.c

index 1682339a8f4e7610703adfd593d71ae3ab6a34c5..8b4b65f3cd46e526c4ac6c8db53a3939eb3c6c8d 100644 (file)
@@ -483,8 +483,10 @@ _PUBLIC_ NTSTATUS auth_anonymous_user_info_dc(TALLOC_CTX *mem_ctx,
                return NT_STATUS_NO_MEMORY;
        };
 
-       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... */
        user_info_dc->user_session_key = data_blob_talloc(user_info_dc, NULL, 16);