s3:winbindd: Call winbind_add_failed_connection_entry() for the correct dc name
authorPavel Filipenský <pfilipensky@samba.org>
Mon, 18 Sep 2023 09:16:39 +0000 (11:16 +0200)
committerPavel Filipensky <pfilipensky@samba.org>
Wed, 11 Oct 2023 16:42:15 +0000 (16:42 +0000)
We were calling winbind_add_failed_connection_entry() for saf_servername
which is NULL.  domain->dcname should be used instead.

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Wed Oct 11 16:42:15 UTC 2023 on atb-devel-224

source3/winbindd/winbindd_cm.c

index 24c68c67ff01ada79b7a3c66253d5c9b51fc8081..014392fdb5da575835f0535e5de3b10070b094c8 100644 (file)
@@ -1480,7 +1480,10 @@ static bool connect_preferred_dc(TALLOC_CTX *mem_ctx,
                                 NULL, -1, NULL, -1,
                                 fd, NULL, 10);
        if (!NT_STATUS_IS_OK(status)) {
-               goto fail;
+               winbind_add_failed_connection_entry(domain,
+                                                   domain->dcname,
+                                                   NT_STATUS_UNSUCCESSFUL);
+               return false;
        }
        return true;