From a7e238d3227347fa8ebcb5813d6a1811f038670f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 19 Jan 2011 22:27:51 +1100 Subject: s4-auth Allow NULL methods to be specified to auth_context_create_methods() This allows us to init an auth context that isn't going to do any NTLM authentication, but is used by other subsystems. Andrew Bartlett --- source4/auth/ntlm/auth.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'source4/auth/ntlm') diff --git a/source4/auth/ntlm/auth.c b/source4/auth/ntlm/auth.c index 7f355d7055..1a98fb414f 100644 --- a/source4/auth/ntlm/auth.c +++ b/source4/auth/ntlm/auth.c @@ -122,12 +122,10 @@ _PUBLIC_ NTSTATUS auth_get_server_info_principal(TALLOC_CTX *mem_ctx, continue; } - NT_STATUS_NOT_OK_RETURN(nt_status); - - break; + return nt_status; } - return NT_STATUS_OK; + return NT_STATUS_NOT_IMPLEMENTED; } /** @@ -437,11 +435,6 @@ _PUBLIC_ NTSTATUS auth_context_create_methods(TALLOC_CTX *mem_ctx, const char ** auth_init(); - if (!methods) { - DEBUG(0,("auth_context_create: No auth method list!?\n")); - return NT_STATUS_INTERNAL_ERROR; - } - if (!ev) { DEBUG(0,("auth_context_create: called with out event context\n")); return NT_STATUS_INTERNAL_ERROR; @@ -463,7 +456,7 @@ _PUBLIC_ NTSTATUS auth_context_create_methods(TALLOC_CTX *mem_ctx, const char ** ctx->sam_ctx = samdb_connect(ctx, ctx->event_ctx, ctx->lp_ctx, system_session(ctx->lp_ctx), 0); } - for (i=0; methods[i] ; i++) { + for (i=0; methods && methods[i] ; i++) { struct auth_method_context *method; method = talloc(ctx, struct auth_method_context); @@ -480,10 +473,6 @@ _PUBLIC_ NTSTATUS auth_context_create_methods(TALLOC_CTX *mem_ctx, const char ** DLIST_ADD_END(ctx->methods, method, struct auth_method_context *); } - if (!ctx->methods) { - return NT_STATUS_INTERNAL_ERROR; - } - ctx->check_password = auth_check_password; ctx->get_challenge = auth_get_challenge; ctx->set_challenge = auth_context_set_challenge; -- cgit