From 0733cfc636f59328592fd581f33834ad0f41c215 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 21 Mar 2025 17:04:05 +0100 Subject: [PATCH] s3:auth: remember make_auth3_context_for_netlogon() was used Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme --- source3/auth/auth.c | 9 ++++++++- source3/include/auth.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/source3/auth/auth.c b/source3/auth/auth.c index b83e98f0a3c..5dd8dba6a49 100644 --- a/source3/auth/auth.c +++ b/source3/auth/auth.c @@ -582,6 +582,7 @@ NTSTATUS make_auth3_context_for_netlogon(TALLOC_CTX *mem_ctx, struct auth_context **auth_context) { const char *methods = NULL; + NTSTATUS status; switch (lp_server_role()) { case ROLE_DOMAIN_BDC: @@ -595,7 +596,13 @@ NTSTATUS make_auth3_context_for_netlogon(TALLOC_CTX *mem_ctx, return NT_STATUS_INVALID_SERVER_STATE; } - return make_auth_context_specific(mem_ctx, auth_context, methods); + status = make_auth_context_specific(mem_ctx, auth_context, methods); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + (*auth_context)->for_netlogon = true; + return NT_STATUS_OK; } NTSTATUS make_auth3_context_for_winbind(TALLOC_CTX *mem_ctx, diff --git a/source3/include/auth.h b/source3/include/auth.h index 69e53bb7083..d0551f33cc2 100644 --- a/source3/include/auth.h +++ b/source3/include/auth.h @@ -93,6 +93,8 @@ struct auth_context { /* What order are the various methods in? Try to stop it changing under us */ struct auth_methods *auth_method_list; + bool for_netlogon; + prepare_gensec_fn prepare_gensec; make_auth4_context_fn make_auth4_context; const char *forced_samba4_methods; -- 2.47.3