From 589a42e2da7d7cd382deb94c57b0c6dbca269e55 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 13 Apr 2010 12:00:06 +1000 Subject: s4:auth Change auth_generate_session_info to take an auth context The auth context was in the past only for NTLM authentication, but we need a SAM, an event context and and loadparm context for calculating the local groups too, so re-use that infrustructure we already have in place. However, to avoid problems where we may not have an auth_context (in torture tests, for example), allow a simpler 'session_info' to be generated, by passing this via an indirection in gensec and an generate_session_info() function pointer in the struct auth_context. In the smb_server (for old-style session setups) we need to change the async context to a new 'struct sesssetup_context'. This allows us to use the auth_context in processing the authentication reply . Andrew Bartlett --- source4/auth/ntlm/auth.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/auth/ntlm/auth.c') diff --git a/source4/auth/ntlm/auth.c b/source4/auth/ntlm/auth.c index d5df387d80..e9e72fa2a5 100644 --- a/source4/auth/ntlm/auth.c +++ b/source4/auth/ntlm/auth.c @@ -25,6 +25,8 @@ #include "auth/auth.h" #include "auth/ntlm/auth_proto.h" #include "param/param.h" +#include "dsdb/samdb/samdb.h" + /*************************************************************************** Set a fixed challenge @@ -435,6 +437,8 @@ _PUBLIC_ NTSTATUS auth_context_create_methods(TALLOC_CTX *mem_ctx, const char ** ctx->msg_ctx = msg; ctx->lp_ctx = lp_ctx; + ctx->sam_ctx = samdb_connect(ctx, ctx->event_ctx, ctx->lp_ctx, system_session(ctx->lp_ctx)); + for (i=0; methods[i] ; i++) { struct auth_method_context *method; @@ -461,6 +465,7 @@ _PUBLIC_ NTSTATUS auth_context_create_methods(TALLOC_CTX *mem_ctx, const char ** ctx->set_challenge = auth_context_set_challenge; ctx->challenge_may_be_modified = auth_challenge_may_be_modified; ctx->get_server_info_principal = auth_get_server_info_principal; + ctx->generate_session_info = auth_generate_session_info; *auth_ctx = ctx; -- cgit