From b6f74717451afa9fcb65cf152034e680442aa213 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 29 Jan 2025 11:34:42 +0100 Subject: [PATCH] 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 --- source4/auth/system_session.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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! */ -- 2.47.3