From a363a7936cefd76d923c1106677ddc5c322e3bc5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 17 Mar 2017 16:46:38 +0100 Subject: [PATCH] auth3: only use "[samba4:]sam" in make_auth3_context_for_winbind() This makes the USER_INFO_LOCAL_SAM_ONLY and AUTH_METHOD_LOCAL_SAM interaction obsolete. BUG: https://bugzilla.samba.org/show_bug.cgi?id=2976 Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- source3/auth/auth.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/source3/auth/auth.c b/source3/auth/auth.c index 11a777a404f..31313c76f77 100644 --- a/source3/auth/auth.c +++ b/source3/auth/auth.c @@ -544,7 +544,24 @@ NTSTATUS make_auth3_context_for_netlogon(TALLOC_CTX *mem_ctx, NTSTATUS make_auth3_context_for_winbind(TALLOC_CTX *mem_ctx, struct auth_context **auth_context) { - return make_auth_context_subsystem(mem_ctx, auth_context); + const char *methods = NULL; + + switch (lp_server_role()) { + case ROLE_STANDALONE: + case ROLE_DOMAIN_MEMBER: + case ROLE_DOMAIN_BDC: + case ROLE_DOMAIN_PDC: + methods = "sam"; + break; + case ROLE_ACTIVE_DIRECTORY_DC: + methods = "samba4:sam"; + break; + default: + DEBUG(5,("Unknown auth method!\n")); + return NT_STATUS_UNSUCCESSFUL; + } + + return make_auth_context_specific(mem_ctx, auth_context, methods); } bool auth3_context_set_challenge(struct auth_context *ctx, uint8_t chal[8],