diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2010-06-01 15:36:56 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-06-30 07:35:31 -0400 |
commit | 780ffc9f6d5e1fcd4df3d390b56cb98878223cc0 (patch) | |
tree | e0d94ce0260b4435f5ea882f356adeac41c8fee7 /src/providers/data_provider_fo.c | |
parent | 2dd3faebcd3cfd00efda38ffd2585d675e696b12 (diff) | |
download | sssd-780ffc9f6d5e1fcd4df3d390b56cb98878223cc0.tar.gz sssd-780ffc9f6d5e1fcd4df3d390b56cb98878223cc0.tar.xz sssd-780ffc9f6d5e1fcd4df3d390b56cb98878223cc0.zip |
Add dns_discovery_domain option
The service discovery used to use the SSSD domain name to perform DNS
queries. This is not an optimal solution, for example from the point of
view of authconfig.
This patch introduces a new option "dns_discovery_domain" that allows to set
the domain part of a DNS SRV query. If this option is not set, the
default behavior is to use the domain part of the machine's hostname.
Fixes: #479
Diffstat (limited to 'src/providers/data_provider_fo.c')
-rw-r--r-- | src/providers/data_provider_fo.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/providers/data_provider_fo.c b/src/providers/data_provider_fo.c index 56a072aee..1654e2227 100644 --- a/src/providers/data_provider_fo.c +++ b/src/providers/data_provider_fo.c @@ -243,9 +243,10 @@ int be_fo_service_add_callback(TALLOC_CTX *memctx, int be_fo_add_srv_server(struct be_ctx *ctx, const char *service_name, const char *query_service, const char *proto, - const char *domain, void *user_data) + void *user_data) { struct be_svc_data *svc; + char *domain; int ret; DLIST_FOR_EACH(svc, ctx->be_fo->svcs) { @@ -257,6 +258,15 @@ int be_fo_add_srv_server(struct be_ctx *ctx, const char *service_name, return ENOENT; } + ret = confdb_get_string(ctx->cdb, svc, ctx->conf_path, + CONFDB_DOMAIN_DNS_DISCOVERY_NAME, + NULL, &domain); + if (ret != EOK) { + DEBUG(1, ("Failed reading %s from confdb\n", + CONFDB_DOMAIN_DNS_DISCOVERY_NAME)); + return ret; + } + ret = fo_add_srv_server(svc->fo_service, query_service, domain, proto, user_data); if (ret && ret != EEXIST) { @@ -461,3 +471,4 @@ int be_fo_run_callbacks_at_next_request(struct be_ctx *ctx, return EOK; } + |