From 9917b96e31df3fa992d235a050ed1dc0e9939b3d Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Mon, 17 Jan 2011 15:14:20 -0500 Subject: Allow fallback to SSSD domain For backwards-compatibility with older versions of the SSSD (such as 1.2.x), we need to be able to have our DNS SRV record lookup be capable of falling back to using the SSSD domain name as the DNS discovery domain. This patch modifies our DNS lookups so that they behave as follows: If dns_discovery_domain is specified, it is considered authoritative. No other discovery domains will be attempted. If dns_discovery_domain is not specified, we first attempt to look up the SRV records using the domain portion of the machine's hostname. If this returns "NOTFOUND", we will try performing an SRV record query using the SSSD domain name as the DNS discovery domain. https://fedorahosted.org/sssd/ticket/754 --- src/providers/data_provider_fo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/providers/data_provider_fo.c') diff --git a/src/providers/data_provider_fo.c b/src/providers/data_provider_fo.c index 0b4b2434..ddb348f6 100644 --- a/src/providers/data_provider_fo.c +++ b/src/providers/data_provider_fo.c @@ -284,7 +284,8 @@ int be_fo_add_srv_server(struct be_ctx *ctx, const char *service_name, /* Add the first protocol as the primary lookup */ ret = fo_add_srv_server(svc->fo_service, query_service, - domain, proto_table[proto], user_data); + domain, ctx->domain->name, + proto_table[proto], user_data); if (ret && ret != EEXIST) { DEBUG(1, ("Failed to add SRV lookup reference to failover service\n")); return ret; @@ -295,7 +296,8 @@ int be_fo_add_srv_server(struct be_ctx *ctx, const char *service_name, /* All the rest as fallback */ while (i != proto) { ret = fo_add_srv_server(svc->fo_service, query_service, - domain, proto_table[i], user_data); + domain, ctx->domain->name, + proto_table[i], user_data); if (ret && ret != EEXIST) { DEBUG(1, ("Failed to add SRV lookup reference to failover service\n")); return ret; -- cgit