]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:auth: remember make_auth3_context_for_netlogon() was used
authorStefan Metzmacher <metze@samba.org>
Fri, 21 Mar 2025 16:04:05 +0000 (17:04 +0100)
committerRalph Boehme <slow@samba.org>
Thu, 3 Apr 2025 09:36:31 +0000 (09:36 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/auth/auth.c
source3/include/auth.h

index b83e98f0a3cc92a5888f0a53295e149223b562b0..5dd8dba6a49396e7579df022f5144e96eaac0f6b 100644 (file)
@@ -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,
index 69e53bb708351c37fc441d846fc1e255282b5598..d0551f33cc2a107538f32fe1256256b610af2a68 100644 (file)
@@ -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;