]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:auth: simplify auth_system_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 31a45174f0ff9655bb9e27f84207b7b86028ad90..1682339a8f4e7610703adfd593d71ae3ab6a34c5 100644 (file)
@@ -138,8 +138,10 @@ NTSTATUS auth_system_user_info_dc(TALLOC_CTX *mem_ctx, const char *netbios_name,
                return NT_STATUS_NO_MEMORY;
        }
 
-       user_info_dc->sids->sid = global_sid_System;
-       user_info_dc->sids->attrs = SE_GROUP_DEFAULT_FLAGS;
+       user_info_dc->sids[0] = (struct auth_SidAttr) {
+               .sid = global_sid_System,
+               .attrs = SE_GROUP_DEFAULT_FLAGS,
+       };
 
        /* annoying, but the Anonymous really does have a session key, 
           and it is all zeros! */