From e3db994ddc8eda225c4cc3c90e9c0bd82281faf6 Mon Sep 17 00:00:00 2001 From: Pavel Březina Date: Fri, 3 May 2013 14:58:46 +0200 Subject: fo_discover_servers_send: don't crash when backup_domain is NULL --- src/providers/fail_over_srv.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/providers/fail_over_srv.c b/src/providers/fail_over_srv.c index 9ff3de982..96c8248fc 100644 --- a/src/providers/fail_over_srv.c +++ b/src/providers/fail_over_srv.c @@ -295,6 +295,17 @@ static void fo_discover_servers_primary_done(struct tevent_req *subreq) goto done; } + if (state->backup_domain == NULL) { + DEBUG(SSSDBG_TRACE_FUNC, ("No backup domain specified\n")); + + if (ret == ERR_SRV_NOT_FOUND || ret == ERR_SRV_LOOKUP_ERROR) { + DEBUG(SSSDBG_MINOR_FAILURE, ("Unable to retrieve primary nor " + "backup servers [%d]: %s\n", ret, sss_strerror(ret))); + } + + goto done; + } + if (strcasecmp(state->dns_domain, state->backup_domain) == 0) { /* primary domain was unreachable, we will use servers from backup * domain as primary */ -- cgit