Blame SOURCES/0082-ad-only-send-cldap-ping-to-our-local-domain.patch

5a92ae
From ed243335d3e74ab2cde49eacc9a85ca5408a8dec Mon Sep 17 00:00:00 2001
5a92ae
From: Sumit Bose <sbose@redhat.com>
5a92ae
Date: Fri, 15 Oct 2021 13:39:50 +0200
5a92ae
Subject: [PATCH 82/83] ad: only send cldap-ping to our local domain
5a92ae
MIME-Version: 1.0
5a92ae
Content-Type: text/plain; charset=UTF-8
5a92ae
Content-Transfer-Encoding: 8bit
5a92ae
5a92ae
Since we are using the name of the local domain in the search filter of
5a92ae
the CLDAP ping only a DC from the local domain can send a proper reply.
5a92ae
DCs from other domains will only return an error so we can skip the
5a92ae
CLDAP ping for those domains.
5a92ae
5a92ae
Resolves: https://github.com/SSSD/sssd/issues/5822
5a92ae
5a92ae
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
5a92ae
(cherry picked from commit 724293d0873ee3229866ae4c13e1c8829375146f)
5a92ae
5a92ae
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
5a92ae
---
5a92ae
 src/providers/ad/ad_cldap_ping.c | 8 ++++++++
5a92ae
 1 file changed, 8 insertions(+)
5a92ae
5a92ae
diff --git a/src/providers/ad/ad_cldap_ping.c b/src/providers/ad/ad_cldap_ping.c
5a92ae
index 100d448f5..91db81bfc 100644
5a92ae
--- a/src/providers/ad/ad_cldap_ping.c
5a92ae
+++ b/src/providers/ad/ad_cldap_ping.c
5a92ae
@@ -621,6 +621,14 @@ struct tevent_req *ad_cldap_ping_send(TALLOC_CTX *mem_ctx,
5a92ae
         goto done;
5a92ae
     }
5a92ae
 
5a92ae
+    if (strcmp(srv_ctx->ad_domain, discovery_domain) != 0) {
5a92ae
+        DEBUG(SSSDBG_TRACE_ALL, "Trying to discover domain [%s] "
5a92ae
+              "which is not our local domain [%s], skipping CLDAP ping.\n",
5a92ae
+              discovery_domain, srv_ctx->ad_domain);
5a92ae
+        ret = EOK;
5a92ae
+        goto done;
5a92ae
+    }
5a92ae
+
5a92ae
     DEBUG(SSSDBG_TRACE_FUNC, "Sending CLDAP ping\n");
5a92ae
 
5a92ae
     state->ev = ev;
5a92ae
-- 
5a92ae
2.26.3
5a92ae