From b48dc10f1ebfa77933f839ec1bf83c35f2471c80 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 22 Mar 2017 09:50:13 +0100 Subject: [PATCH] auth4: implement the deprecated 'auth methods' in auth_methods_from_lp() This might be used to explicitly configure the old auth methods list from Samba 4.6 and older, if required: "auth methods = anonymous sam_ignoredomain" But this option will be removed again in future releases. BUG: https://bugzilla.samba.org/show_bug.cgi?id=2976 BUG: https://bugzilla.samba.org/show_bug.cgi?id=12709 Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- source4/auth/ntlm/auth.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source4/auth/ntlm/auth.c b/source4/auth/ntlm/auth.c index 26025dcc240..ee98cac6ea3 100644 --- a/source4/auth/ntlm/auth.c +++ b/source4/auth/ntlm/auth.c @@ -608,6 +608,20 @@ _PUBLIC_ NTSTATUS auth_context_create_methods(TALLOC_CTX *mem_ctx, const char * const char **auth_methods_from_lp(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) { char **auth_methods = NULL; + const char **const_auth_methods = NULL; + + /* + * As 'auth methods' is deprecated it will be removed + * in future releases again, but for now give + * admins the flexibility to configure, the behavior + * from Samba 4.6: "auth methods = anonymous sam_ignoredomain", + * for a while. + */ + const_auth_methods = lpcfg_auth_methods(lp_ctx); + if (const_auth_methods != NULL) { + DBG_NOTICE("using deprecated 'auth methods' values.\n"); + return const_auth_methods; + } switch (lpcfg_server_role(lp_ctx)) { case ROLE_STANDALONE: -- 2.11.4.GIT