diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2012-03-27 18:00:18 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-03-29 15:06:58 -0400 |
commit | 64f398dca52df6313169f33cfc20a69d51c3bc2b (patch) | |
tree | 1b2f903d41dc44cccb925fb1ee2ffafa7e1f3a42 /src/providers | |
parent | 51e6f026f7b8bcd6c429b10044abacc4f2393305 (diff) | |
download | sssd-64f398dca52df6313169f33cfc20a69d51c3bc2b.tar.gz sssd-64f398dca52df6313169f33cfc20a69d51c3bc2b.tar.bz2 sssd-64f398dca52df6313169f33cfc20a69d51c3bc2b.zip |
Return correct resolv_status on resolver timeout
https://fedorahosted.org/sssd/ticket/1274
Diffstat (limited to 'src/providers')
-rw-r--r-- | src/providers/fail_over.c | 22 | ||||
-rw-r--r-- | src/providers/ipa/ipa_dyndns.c | 7 |
2 files changed, 17 insertions, 12 deletions
diff --git a/src/providers/fail_over.c b/src/providers/fail_over.c index b8310684..deb7d394 100644 --- a/src/providers/fail_over.c +++ b/src/providers/fail_over.c @@ -946,12 +946,8 @@ fo_resolve_service_done(struct tevent_req *subreq) /* Take care of all requests for this server. */ while ((request = common->request_list) != NULL) { DLIST_REMOVE(common->request_list, request); - if (resolv_status) { - /* FIXME FIXME: resolv_status is an ARES error. - * but any caller will expect classic error codes. - * also the send() function may return ENOENT, so this mix - * IS explosive (ENOENT = 2 = ARES_EFORMER) */ - tevent_req_error(request->req, resolv_status); + if (ret) { + tevent_req_error(request->req, ret); } else { tevent_req_done(request->req); } @@ -1285,16 +1281,20 @@ static void resolve_get_domain_done(struct tevent_req *subreq) struct resolve_get_domain_state); struct resolv_hostent *rhostent; int ret; + int resolv_status; - ret = resolv_gethostbyname_recv(subreq, req, NULL, NULL, &rhostent); + ret = resolv_gethostbyname_recv(subreq, req, &resolv_status, + NULL, &rhostent); talloc_zfree(subreq); if (ret) { - DEBUG(2, ("Could not get fully qualified name for host name %s " - "resolver returned: [%d]: %s\n", - state->hostname, ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, + ("Could not get fully qualified name for host name %s " + "error [%d]: %s, resolver returned: [%d]: %s\n", + state->hostname, ret, strerror(ret), resolv_status, + resolv_strerror(resolv_status))); /* We'll proceed with hostname in this case */ } else { - DEBUG(7, ("The full FQDN is: %s\n", rhostent->name)); + DEBUG(SSSDBG_TRACE_LIBS, ("The full FQDN is: %s\n", rhostent->name)); state->fqdn = rhostent->name; } tevent_req_done(req); diff --git a/src/providers/ipa/ipa_dyndns.c b/src/providers/ipa/ipa_dyndns.c index 089f8fba..71fc27bc 100644 --- a/src/providers/ipa/ipa_dyndns.c +++ b/src/providers/ipa/ipa_dyndns.c @@ -639,8 +639,9 @@ ipa_dyndns_update_get_addrs_done(struct tevent_req *subreq) struct ipa_dyndns_update_get_addrs_state); struct resolv_hostent *rhostent; int i; + int resolv_status; - ret = resolv_gethostbyname_recv(subreq, state, NULL, NULL, + ret = resolv_gethostbyname_recv(subreq, state, &resolv_status, NULL, &rhostent); talloc_zfree(subreq); @@ -666,6 +667,10 @@ ipa_dyndns_update_get_addrs_done(struct tevent_req *subreq) tevent_req_done(req); return; } else if (ret != EOK) { + DEBUG(SSSDBG_OP_FAILURE, + ("Could not resolve address for this machine, error [%d]: %s, " + "resolver returned: [%d]: %s\n", ret, strerror(ret), + resolv_status, resolv_strerror(resolv_status))); tevent_req_error(req, ret); return; } |