s3:libads: Improve logging for failover scenarios
authorPavel Filipenský <pfilipensky@samba.org>
Wed, 18 Oct 2023 09:32:57 +0000 (11:32 +0200)
committerJule Anger <janger@samba.org>
Mon, 23 Oct 2023 08:37:14 +0000 (08:37 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15499

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Wed Oct 18 15:47:09 UTC 2023 on atb-devel-224

(cherry picked from commit 14600a3128c6b66de4f9291eeec52e34725030c5)

source3/libads/ldap.c

index 2853e15dfd38f43f6c08a2dd7c21558a85de7c00..cc00753ff7461ab77823167fa74b6475f50b2f6e 100644 (file)
@@ -478,6 +478,12 @@ again:
                num_requests += 1;
        }
 
+       DBG_DEBUG("Try to create %zu netlogon connections for domain '%s' "
+                 "(provided count of addresses was %zu).\n",
+                 num_requests,
+                 domain,
+                 count);
+
        if (num_requests == 0) {
                status = NT_STATUS_NO_LOGON_SERVERS;
                DBG_WARNING("domain[%s] num_requests[%zu] for count[%zu] - %s\n",
@@ -855,6 +861,8 @@ ADS_STATUS ads_connect(ADS_STRUCT *ads)
                bool ok = false;
                struct sockaddr_storage ss;
 
+               DBG_DEBUG("Resolving name of LDAP server '%s'.\n",
+                         ads->server.ldap_server);
                ok = resolve_name(ads->server.ldap_server, &ss, 0x20, true);
                if (!ok) {
                        DEBUG(5,("ads_connect: unable to resolve name %s\n",
@@ -900,6 +908,8 @@ ADS_STATUS ads_connect(ADS_STRUCT *ads)
                 * Keep trying to find a server and fall through
                 * into ads_find_dc() again.
                 */
+               DBG_DEBUG("Failed to connect to DC via LDAP server IP address, "
+                         "trying to find another DC.\n");
        }
 
        ntstatus = ads_find_dc(ads);