]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
winbindd: always use winbind_add_failed_connection_entry() wrapper
authorStefan Metzmacher <metze@samba.org>
Wed, 16 Feb 2022 13:18:50 +0000 (14:18 +0100)
committerJule Anger <janger@samba.org>
Wed, 6 Aug 2025 08:08:10 +0000 (08:08 +0000)
We should not use add_failed_connection_entry() directly.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14981

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 7fed75c495ead8f476c805b91cc6624ebf933427)

source3/winbindd/winbindd_cm.c
source3/winbindd/winbindd_pam.c
source3/winbindd/winbindd_proto.h

index 9e51ee2acfeb44aaea61939453c578204d6c5163..53800988306902510294b677a28d0ae909e78d5c 100644 (file)
@@ -320,7 +320,7 @@ void set_domain_online_request(struct winbindd_domain *domain)
  Add -ve connection cache entries for domain and realm.
 ****************************************************************/
 
-static void winbind_add_failed_connection_entry(
+void winbind_add_failed_connection_entry(
        const struct winbindd_domain *domain,
        const char *server,
        NTSTATUS result)
index 450030fcbf1707c9dc76fd569555d59d30c253ba..8d68ed198e3fc6435998e825167fe1207c019175 100644 (file)
@@ -1709,10 +1709,9 @@ static NTSTATUS winbind_samlogon_retry_loop(struct winbindd_domain *domain,
                                DEBUG(3, ("This is the third problem for this "
                                          "particular call, adding DC to the "
                                          "negative cache list: %s %s\n", domain->name, domain->dcname));
-                               add_failed_connection_entry(domain->name,
+                               winbind_add_failed_connection_entry(domain,
                                                            domain->dcname,
                                                            result);
-                               saf_delete(domain->name);
                        }
 
                        /* Only allow 3 retries */
index e318911d19212580a1464f1744c0551517177bd2..9fc037eb04e5be0b54b89cf9116600fc19a14870 100644 (file)
@@ -206,6 +206,10 @@ void winbind_msg_domain_online(struct messaging_context *msg_ctx,
 
 void set_domain_offline(struct winbindd_domain *domain);
 void set_domain_online_request(struct winbindd_domain *domain);
+void winbind_add_failed_connection_entry(
+       const struct winbindd_domain *domain,
+       const char *server,
+       NTSTATUS result);
 
 struct cli_credentials;
 NTSTATUS winbindd_get_trust_credentials(struct winbindd_domain *domain,