From 5304efd88f9346f5f260d3c56c5b35f771a71777 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Mar 01 2012 15:03:45 +0000 Subject: IPA: Set the DNS discovery domain to match ipa_domain https://fedorahosted.org/sssd/ticket/1217 --- diff --git a/src/providers/data_provider_fo.c b/src/providers/data_provider_fo.c index dd73e9d..8d7cbbf 100644 --- a/src/providers/data_provider_fo.c +++ b/src/providers/data_provider_fo.c @@ -248,8 +248,11 @@ int be_fo_service_add_callback(TALLOC_CTX *memctx, return EOK; } -int be_fo_add_srv_server(struct be_ctx *ctx, const char *service_name, - const char *query_service, enum be_fo_protocol proto, +int be_fo_add_srv_server(struct be_ctx *ctx, + const char *service_name, + const char *query_service, + const char *default_discovery_domain, + enum be_fo_protocol proto, bool proto_fallback, void *user_data) { struct be_svc_data *svc; @@ -264,7 +267,7 @@ int be_fo_add_srv_server(struct be_ctx *ctx, const char *service_name, ret = confdb_get_string(ctx->cdb, svc, ctx->conf_path, CONFDB_DOMAIN_DNS_DISCOVERY_NAME, - NULL, &domain); + default_discovery_domain, &domain); if (ret != EOK) { DEBUG(1, ("Failed reading %s from confdb\n", CONFDB_DOMAIN_DNS_DISCOVERY_NAME)); diff --git a/src/providers/dp_backend.h b/src/providers/dp_backend.h index fc79d45..b6b3db5 100644 --- a/src/providers/dp_backend.h +++ b/src/providers/dp_backend.h @@ -195,8 +195,11 @@ int be_fo_service_add_callback(TALLOC_CTX *memctx, struct be_ctx *ctx, const char *service_name, be_svc_callback_fn_t *fn, void *private_data); int be_fo_get_server_count(struct be_ctx *ctx, const char *service_name); -int be_fo_add_srv_server(struct be_ctx *ctx, const char *service_name, - const char *query_service, enum be_fo_protocol proto, +int be_fo_add_srv_server(struct be_ctx *ctx, + const char *service_name, + const char *query_service, + const char *default_discovery_domain, + enum be_fo_protocol proto, bool proto_fallback, void *user_data); int be_fo_add_server(struct be_ctx *ctx, const char *service_name, const char *server, int port, void *user_data); diff --git a/src/providers/ipa/ipa_common.c b/src/providers/ipa/ipa_common.c index 8307f6a..e95eeab 100644 --- a/src/providers/ipa/ipa_common.c +++ b/src/providers/ipa/ipa_common.c @@ -938,6 +938,7 @@ int ipa_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx, struct ipa_service *service; char **list = NULL; char *realm; + char *ipa_domain; int ret; int i; @@ -1011,7 +1012,8 @@ int ipa_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx, talloc_steal(service, list[i]); if (be_fo_is_srv_identifier(list[i])) { - ret = be_fo_add_srv_server(ctx, "IPA", "ldap", + ipa_domain = dp_opt_get_string(options->basic, IPA_DOMAIN); + ret = be_fo_add_srv_server(ctx, "IPA", "ldap", ipa_domain, BE_FO_PROTO_TCP, false, NULL); if (ret) { DEBUG(0, ("Failed to add server\n")); diff --git a/src/providers/krb5/krb5_common.c b/src/providers/krb5/krb5_common.c index c2cb94b..104d613 100644 --- a/src/providers/krb5/krb5_common.c +++ b/src/providers/krb5/krb5_common.c @@ -516,7 +516,7 @@ int krb5_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx, } if (be_fo_is_srv_identifier(server_spec)) { - ret = be_fo_add_srv_server(ctx, service_name, service_name, + ret = be_fo_add_srv_server(ctx, service_name, service_name, NULL, BE_FO_PROTO_UDP, true, NULL); if (ret) { DEBUG(0, ("Failed to add server\n")); diff --git a/src/providers/ldap/ldap_common.c b/src/providers/ldap/ldap_common.c index 9a90814..d5dc4a0 100644 --- a/src/providers/ldap/ldap_common.c +++ b/src/providers/ldap/ldap_common.c @@ -1388,7 +1388,8 @@ int sdap_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx, goto done; } - ret = be_fo_add_srv_server(ctx, service_name, dns_service_name, + ret = be_fo_add_srv_server(ctx, service_name, + dns_service_name, NULL, BE_FO_PROTO_TCP, false, srv_user_data); if (ret) { DEBUG(0, ("Failed to add server\n"));