From 3136462ea9d2b97e5385386e2c37b1ac403db6ca Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 10 Jan 2005 12:14:26 +0000 Subject: r4639: initialize all struct members! tridge: sorry for making you such a pain... could you check if that fixes your bugs metze (This used to be commit c215372eb0916df1e532b77c8365f401a8c32a38) --- source4/rpc_server/netlogon/dcerpc_netlogon.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'source4') diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c index 0733a467f7..259f43895b 100644 --- a/source4/rpc_server/netlogon/dcerpc_netlogon.c +++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c @@ -563,21 +563,21 @@ static NTSTATUS netr_LogonSamLogonEx(struct dcesrv_call_state *dce_call, TALLOC_ sam->group_count = 0; sam->groupids = NULL; sam->user_flags = 0; /* TODO: w2k3 uses 0x120 - what is this? */ - sam->acct_flags = server_info->acct_flags; + sam->acct_flags = server_info->acct_flags; sam->logon_server.string = lp_netbios_name(); - sam->domain.string = server_info->domain_name; sam->domain_sid = dom_sid_dup(mem_ctx, server_info->account_sid); NT_STATUS_HAVE_NO_MEMORY(sam->domain_sid); sam->domain_sid->num_auths--; + ZERO_ARRAY(sam->unknown); + + ZERO_STRUCT(sam->key); if (server_info->user_session_key.length == sizeof(sam->key.key)) { memcpy(sam->key.key, server_info->user_session_key.data, sizeof(sam->key.key)); - } else { - ZERO_STRUCT(sam->key.key); } - + /* Don't crypt an all-zero key, it would give away the NETLOGON pipe session key */ /* It appears that level 6 is not individually encrypted */ if ((r->in.validation_level != 6) @@ -591,12 +591,11 @@ static NTSTATUS netr_LogonSamLogonEx(struct dcesrv_call_state *dce_call, TALLOC_ sizeof(sam->key.key)); } } - + + ZERO_STRUCT(sam->LMSessKey); if (server_info->lm_session_key.length == sizeof(sam->LMSessKey.key)) { memcpy(sam->LMSessKey.key, server_info->lm_session_key.data, sizeof(sam->LMSessKey.key)); - } else { - ZERO_STRUCT(sam->LMSessKey.key); } /* Don't crypt an all-zero key, it would give away the NETLOGON pipe session key */ -- cgit