dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

Blame SOURCES/0014-failover-check-dns_domain-if-primary-servers-lookup-.patch

2fc102
From 0926cec5b98218131ac822e1684f9bce7aa0072c Mon Sep 17 00:00:00 2001
2fc102
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
2fc102
Date: Thu, 5 Dec 2013 13:19:16 +0100
2fc102
Subject: [PATCH 14/15] failover: check dns_domain if primary servers lookup
2fc102
 failed
2fc102
2fc102
If primary servers lookup failed, dns_domain is not set.
2fc102
2fc102
Resolves:
2fc102
https://fedorahosted.org/sssd/ticket/2173
2fc102
---
2fc102
 src/providers/fail_over_srv.c | 10 +++++++---
2fc102
 1 file changed, 7 insertions(+), 3 deletions(-)
2fc102
2fc102
diff --git a/src/providers/fail_over_srv.c b/src/providers/fail_over_srv.c
2fc102
index 543516ef19e288556e39e61b400a628c94e2817b..c27416899e30b3cf8b3c0496adb08089f4b2c11d 100644
2fc102
--- a/src/providers/fail_over_srv.c
2fc102
+++ b/src/providers/fail_over_srv.c
2fc102
@@ -302,13 +302,17 @@ static void fo_discover_servers_primary_done(struct tevent_req *subreq)
2fc102
     }
2fc102
 
2fc102
     if (state->backup_domain == NULL) {
2fc102
+        /* if there is no backup domain, we are done */
2fc102
         DEBUG(SSSDBG_TRACE_FUNC, ("No backup domain specified\n"));
2fc102
         goto done;
2fc102
     }
2fc102
 
2fc102
-    if (strcasecmp(state->dns_domain, state->backup_domain) == 0) {
2fc102
-        /* primary domain was unreachable, we will use servers from backup
2fc102
-         * domain as primary */
2fc102
+    if (state->dns_domain != NULL
2fc102
+            && strcasecmp(state->dns_domain, state->backup_domain) == 0) {
2fc102
+        /* If there was no error and dns_domain is the same as backup domain,
2fc102
+         * it means that we were unable to resolve SRV in primary domain, but
2fc102
+         * SRV from backup domain was resolved and those servers are considered
2fc102
+         * to be primary. We are done. */
2fc102
         state->backup_servers = NULL;
2fc102
         state->num_backup_servers = 0;
2fc102
 
2fc102
-- 
2fc102
1.8.4.2
2fc102