diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-07-27 11:24:18 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:10:25 -0500 |
commit | e8623667d32f717b0b746e5041500bd0ee6b3ae8 (patch) | |
tree | d789a33d4bf6f41b6e525478fe943b387500de2b /source4/auth/auth_unix.c | |
parent | 28b8ec0156e99d7bddc2aa243f6631a66c94a078 (diff) | |
download | samba-e8623667d32f717b0b746e5041500bd0ee6b3ae8.tar.gz samba-e8623667d32f717b0b746e5041500bd0ee6b3ae8.tar.bz2 samba-e8623667d32f717b0b746e5041500bd0ee6b3ae8.zip |
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)
Diffstat (limited to 'source4/auth/auth_unix.c')
-rw-r--r-- | source4/auth/auth_unix.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/source4/auth/auth_unix.c b/source4/auth/auth_unix.c index 959eb6703c..635c45b399 100644 --- a/source4/auth/auth_unix.c +++ b/source4/auth/auth_unix.c @@ -773,20 +773,26 @@ static NTSTATUS check_unix_password(TALLOC_CTX *ctx, const struct auth_usersuppl * **/ +static NTSTATUS authunix_want_check(struct auth_method_context *ctx, + TALLOC_CTX *mem_ctx, + const struct auth_usersupplied_info *user_info) +{ + if (!user_info->mapped.account_name || !*user_info->mapped.account_name) { + return NT_STATUS_NOT_IMPLEMENTED; + } + + return NT_STATUS_OK; +} + static NTSTATUS authunix_check_password(struct auth_method_context *ctx, TALLOC_CTX *mem_ctx, const struct auth_usersupplied_info *user_info, - struct auth_serversupplied_info **server_info) + struct auth_serversupplied_info **server_info) { TALLOC_CTX *check_ctx; NTSTATUS nt_status; struct passwd *pwd; - if (! user_info->mapped.account_name || ! *user_info->mapped.account_name) { - /* 'not for me' */ - return NT_STATUS_NOT_IMPLEMENTED; - } - if (user_info->password_state != AUTH_PASSWORD_PLAIN) { return NT_STATUS_INVALID_PARAMETER; } @@ -797,13 +803,13 @@ static NTSTATUS authunix_check_password(struct auth_method_context *ctx, } nt_status = check_unix_password(check_ctx, user_info, &pwd); - if ( ! NT_STATUS_IS_OK(nt_status)) { + if (!NT_STATUS_IS_OK(nt_status)) { talloc_free(check_ctx); return nt_status; } nt_status = authunix_make_server_info(mem_ctx, user_info, pwd, server_info); - if ( ! NT_STATUS_IS_OK(nt_status)) { + if (!NT_STATUS_IS_OK(nt_status)) { talloc_free(check_ctx); return nt_status; } @@ -815,7 +821,8 @@ static NTSTATUS authunix_check_password(struct auth_method_context *ctx, static const struct auth_operations unix_ops = { .name = "unix", .get_challenge = auth_get_challenge_not_implemented, - .check_password = authunix_check_password + .want_check = authunix_want_check, + .check_password = authunix_check_password }; NTSTATUS auth_unix_init(void) |