From 52b28ec813ff3696606fc8f3a6bf4759a1a104e5 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 18 Jul 2011 13:55:20 +1000 Subject: auth: Split out make_user_info_SamBaseInfo and add authenticated argument This will allow the source3 auth code to call this without needing to double-parse the SIDs Andrew Bartlett Signed-off-by: Andrew Tridgell --- source3/auth/auth_util.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'source3/auth') diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index 0ef7df88b3..0627911aeb 100644 --- a/source3/auth/auth_util.c +++ b/source3/auth/auth_util.c @@ -465,8 +465,6 @@ NTSTATUS create_local_token(TALLOC_CTX *mem_ctx, struct dom_sid tmp_sid; struct auth_session_info *session_info; struct wbcUnixId *ids; - struct auth_user_info_dc *user_info_dc; - union netr_Validation val; /* Ensure we can't possible take a code path leading to a * null defref. */ @@ -547,22 +545,16 @@ NTSTATUS create_local_token(TALLOC_CTX *mem_ctx, return NT_STATUS_OK; } - val.sam3 = server_info->info3; - - /* Convert into something we can build a struct - * auth_session_info from. Most of the work here - * will be to convert the SIDS, which we will then ignore, but - * this is the easier way to handle it */ - status = make_user_info_dc_netlogon_validation(talloc_tos(), "", 3, &val, &user_info_dc); + /* We need to populate session_info->info with the information found in server_info->info3 */ + status = make_user_info_SamBaseInfo(session_info, "", &server_info->info3->base, + server_info->guest == false, + &session_info->info); if (!NT_STATUS_IS_OK(status)) { - DEBUG(0, ("conversion of info3 into user_info_dc failed!\n")); + DEBUG(0, ("conversion of info3 into auth_user_info failed!\n")); TALLOC_FREE(session_info); return status; } - session_info->info = talloc_move(session_info, &user_info_dc->info); - talloc_free(user_info_dc); - /* * If winbind is not around, we can not make much use of the SIDs the * domain controller provided us with. Likewise if the user name was -- cgit