From 8c0f12065602c3d38b49350b486a12d6e6599cbf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pavel=20Filipensk=C3=BD?= Date: Wed, 18 Oct 2023 11:32:57 +0200 Subject: [PATCH] s3:libads: Improve logging for failover scenarios MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit BUG: https://bugzilla.samba.org/show_bug.cgi?id=15499 Signed-off-by: Pavel Filipenský Reviewed-by: Andreas Schneider Autobuild-User(master): Pavel Filipensky Autobuild-Date(master): Wed Oct 18 15:47:09 UTC 2023 on atb-devel-224 (cherry picked from commit 14600a3128c6b66de4f9291eeec52e34725030c5) --- source3/libads/ldap.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index 2853e15dfd3..cc00753ff74 100644 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -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); -- 2.11.4.GIT