From e8623667d32f717b0b746e5041500bd0ee6b3ae8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 27 Jul 2006 11:24:18 +0000 Subject: r17270: split the logic of saying this auth backend wants to handle this request from the password checking. This will help to make the password checking hook async later metze (This used to be commit 5b26cbc3428b4c186235cc08c9ace1c23f59dd7f) --- source4/auth/auth.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'source4/auth/auth.c') diff --git a/source4/auth/auth.c b/source4/auth/auth.c index dfef0c8c4d..0b044af495 100644 --- a/source4/auth/auth.c +++ b/source4/auth/auth.c @@ -174,16 +174,20 @@ NTSTATUS auth_check_password(struct auth_context *auth_ctx, for (method = auth_ctx->methods; method; method = method->next) { NTSTATUS result; - result = method->ops->check_password(method, mem_ctx, user_info, server_info); - - /* check if the module did anything */ - if (!NT_STATUS_EQUAL(result, NT_STATUS_NOT_IMPLEMENTED)) { - method_name = method->ops->name; - nt_status = result; - break; + /* check if the module wants to chek the password */ + result = method->ops->want_check(method, mem_ctx, user_info); + if (NT_STATUS_EQUAL(result, NT_STATUS_NOT_IMPLEMENTED)) { + DEBUG(11,("auth_check_password: %s had nothing to say\n", method->ops->name)); + continue; } - DEBUG(11,("auth_check_password: %s had nothing to say\n", method->ops->name)); + method_name = method->ops->name; + nt_status = result; + + if (!NT_STATUS_IS_OK(nt_status)) break; + + nt_status = method->ops->check_password(method, mem_ctx, user_info, server_info); + break; } if (!NT_STATUS_IS_OK(nt_status)) { -- cgit