diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-02-13 14:02:49 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-02-13 14:02:49 +1100 |
commit | cd6026135d3dc7eaa773c60aa168bae8f3f15502 (patch) | |
tree | 9843b78f5fbb32605b6a6f7527783b13995187f8 /source4/auth/ntlm/auth.c | |
parent | 71632a16977a93968b0d520a491a52f635e611a1 (diff) | |
download | samba-cd6026135d3dc7eaa773c60aa168bae8f3f15502.tar.gz samba-cd6026135d3dc7eaa773c60aa168bae8f3f15502.tar.bz2 samba-cd6026135d3dc7eaa773c60aa168bae8f3f15502.zip |
Push sam_get_server_info_principal into the auth subsystem
This means it must be accessed via the supplied auth_context in the
GENSEC server, and should remove the hard depenceny of GENSEC on the
auth subsystem and ldb (allowing LDB not to rely on LDB is considered
a good thing, apparently)
Andrew Bartlett
Diffstat (limited to 'source4/auth/ntlm/auth.c')
-rw-r--r-- | source4/auth/ntlm/auth.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source4/auth/ntlm/auth.c b/source4/auth/ntlm/auth.c index 2aae4a075e..5520c9d01f 100644 --- a/source4/auth/ntlm/auth.c +++ b/source4/auth/ntlm/auth.c @@ -103,6 +103,36 @@ _PUBLIC_ NTSTATUS auth_get_challenge(struct auth_context *auth_ctx, const uint8_ return NT_STATUS_OK; } +/**************************************************************************** + Try to get a challenge out of the various authentication modules. + Returns a const char of length 8 bytes. +****************************************************************************/ +_PUBLIC_ NTSTATUS auth_get_server_info_principal(TALLOC_CTX *mem_ctx, + struct auth_context *auth_ctx, + const char *principal, + struct auth_serversupplied_info **server_info) +{ + NTSTATUS nt_status; + struct auth_method_context *method; + + for (method = auth_ctx->methods; method; method = method->next) { + if (!method->ops->get_server_info_principal) { + continue; + } + + nt_status = method->ops->get_server_info_principal(mem_ctx, auth_ctx, principal, server_info); + if (NT_STATUS_EQUAL(nt_status, NT_STATUS_NOT_IMPLEMENTED)) { + continue; + } + + NT_STATUS_NOT_OK_RETURN(nt_status); + + break; + } + + return NT_STATUS_OK; +} + struct auth_check_password_sync_state { bool finished; NTSTATUS status; @@ -411,6 +441,7 @@ _PUBLIC_ NTSTATUS auth_context_create_methods(TALLOC_CTX *mem_ctx, const char ** ctx->get_challenge = auth_get_challenge; 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; *auth_ctx = ctx; |