diff options
author | Pavel Březina <pbrezina@redhat.com> | 2015-07-28 13:49:37 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-07-29 17:24:15 +0200 |
commit | cbbd8ce524a7e1ae0a1b553c2af18fbef59a06ce (patch) | |
tree | 7f08f46abda1b343be946b6ebd8c13c2beb8752f /src | |
parent | cebf9d194dc99a1ef4acae3d63faa3eb65be695a (diff) | |
download | sssd-cbbd8ce524a7e1ae0a1b553c2af18fbef59a06ce.tar.gz sssd-cbbd8ce524a7e1ae0a1b553c2af18fbef59a06ce.tar.xz sssd-cbbd8ce524a7e1ae0a1b553c2af18fbef59a06ce.zip |
AD: Use ad_site also when site search fails
https://fedorahosted.org/sssd/ticket/2725
Some deployments use the ad_site option for cases where the AD clients
are not able to find a site for one reason or another. With our current
code, the ad_site option value can only override a site that the client
found, not supply the value for cases no site could be found.
This patch fixes the issue.
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/providers/ad/ad_srv.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/providers/ad/ad_srv.c b/src/providers/ad/ad_srv.c index 910f82dd0..123aac6a4 100644 --- a/src/providers/ad/ad_srv.c +++ b/src/providers/ad/ad_srv.c @@ -541,7 +541,7 @@ done: int ad_get_client_site_recv(TALLOC_CTX *mem_ctx, struct tevent_req *req, const char **_site, - char **_forest) + const char **_forest) { struct ad_get_client_site_state *state = NULL; state = tevent_req_data(req, struct ad_get_client_site_state); @@ -617,7 +617,7 @@ struct ad_srv_plugin_state { const char *site; char *dns_domain; uint32_t ttl; - char *forest; + const char *forest; struct fo_server_info *primary_servers; size_t num_primary_servers; struct fo_server_info *backup_servers; @@ -774,6 +774,14 @@ static void ad_srv_plugin_site_done(struct tevent_req *subreq) "using configured value: '%s' instead.\n", state->site, state->ctx->ad_site_override); state->site = state->ctx->ad_site_override; + + if (state->forest == NULL) { + DEBUG(SSSDBG_TRACE_FUNC, "Missing forest information, using %s\n", + state->discovery_domain); + state->forest = state->discovery_domain; + } + + ret = EOK; } if (ret == EOK) { if (strcmp(state->service, "gc") == 0) { |