From: Stefan Metzmacher Date: Wed, 29 Jan 2025 10:34:42 +0000 (+0100) Subject: s4:auth: simplify auth_system_user_info_dc() X-Git-Tag: tevent-0.17.0~776 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6f74717451afa9fcb65cf152034e680442aa213;p=thirdparty%2Fsamba.git s4:auth: simplify auth_system_user_info_dc() By using (struct auth_SidAttr) {} we don't leave uninitialized memory if struct auth_SidAttr changes. Signed-off-by: Stefan Metzmacher Reviewed-by: Jennifer Sutton --- diff --git a/source4/auth/system_session.c b/source4/auth/system_session.c index 31a45174f0f..1682339a8f4 100644 --- a/source4/auth/system_session.c +++ b/source4/auth/system_session.c @@ -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! */