diff options
author | Andrew Bartlett <abartlet@samba.org> | 2014-03-27 09:18:04 +1300 |
---|---|---|
committer | David Disseldorp <ddiss@samba.org> | 2014-04-02 11:05:46 +0200 |
commit | dd499395a5eafeb469a17d31da63cc963b067752 (patch) | |
tree | d1a051fc35345d7913d16beb7146e2f40d712a35 /source3/auth/auth_samba4.c | |
parent | 4d50c751595511936c3d9a44ebb26a925c50a8bc (diff) | |
download | samba-dd499395a5eafeb469a17d31da63cc963b067752.tar.gz samba-dd499395a5eafeb469a17d31da63cc963b067752.tar.xz samba-dd499395a5eafeb469a17d31da63cc963b067752.zip |
auth_samba4: Fix auth_samba4 to correctly provide a messaging context for itself
This is done by calling make_auth4_context_s4(), avoiding code duplication.
Change-Id: I3a3bf4e4273f27078c308d55102e4a1f4b052d17
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Diffstat (limited to 'source3/auth/auth_samba4.c')
-rw-r--r-- | source3/auth/auth_samba4.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/source3/auth/auth_samba4.c b/source3/auth/auth_samba4.c index 0350fec3455..49a77e8d122 100644 --- a/source3/auth/auth_samba4.c +++ b/source3/auth/auth_samba4.c @@ -31,6 +31,9 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_AUTH +static NTSTATUS make_auth4_context_s4(TALLOC_CTX *mem_ctx, + struct auth4_context **auth4_context); + static struct idr_context *task_id_tree; static int free_task_id(struct server_id *server_id) @@ -84,8 +87,8 @@ static struct server_id *new_server_id_task(TALLOC_CTX *mem_ctx) */ /* - * This hook is currently unused, as all NTLM logins go via the hooks - * provided by make_auth4_context_s4() below. + * This hook is currently used by winbindd only, as all other NTLM + * logins go via the hooks provided by make_auth4_context_s4() below. * * This is only left in case we find a way that it might become useful * in future. Importantly, this routine returns the information @@ -107,22 +110,12 @@ static NTSTATUS check_samba4_security(const struct auth_context *auth_context, NTSTATUS nt_status; struct auth_user_info_dc *user_info_dc; struct auth4_context *auth4_context; - struct loadparm_context *lp_ctx; - lp_ctx = loadparm_init_s3(frame, loadparm_s3_helpers()); - if (lp_ctx == NULL) { - DEBUG(10, ("loadparm_init_s3 failed\n")); - talloc_free(frame); - return NT_STATUS_INVALID_SERVER_STATE; + nt_status = make_auth4_context_s4(mem_ctx, &auth4_context); + if (!NT_STATUS_IS_OK(nt_status)) { + TALLOC_FREE(frame); + goto done; } - - /* We create a private tevent context here to avoid nested loops in - * the s3 one, as that may not be expected */ - nt_status = auth_context_create(mem_ctx, - s4_event_context_init(frame), NULL, - lp_ctx, - &auth4_context); - NT_STATUS_NOT_OK_RETURN(nt_status); nt_status = auth_context_set_challenge(auth4_context, auth_context->challenge.data, "auth_samba4"); if (!NT_STATUS_IS_OK(nt_status)) { |