summaryrefslogtreecommitdiffstats
path: root/src/resolv
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-03-27 18:00:18 -0400
committerStephen Gallagher <sgallagh@redhat.com>2012-03-29 15:06:58 -0400
commit64f398dca52df6313169f33cfc20a69d51c3bc2b (patch)
tree1b2f903d41dc44cccb925fb1ee2ffafa7e1f3a42 /src/resolv
parent51e6f026f7b8bcd6c429b10044abacc4f2393305 (diff)
downloadsssd-64f398dca52df6313169f33cfc20a69d51c3bc2b.tar.gz
sssd-64f398dca52df6313169f33cfc20a69d51c3bc2b.tar.xz
sssd-64f398dca52df6313169f33cfc20a69d51c3bc2b.zip
Return correct resolv_status on resolver timeout
https://fedorahosted.org/sssd/ticket/1274
Diffstat (limited to 'src/resolv')
-rw-r--r--src/resolv/async_resolv.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/resolv/async_resolv.c b/src/resolv/async_resolv.c
index 1fbd671a9..ff19050b0 100644
--- a/src/resolv/async_resolv.c
+++ b/src/resolv/async_resolv.c
@@ -511,7 +511,9 @@ resolv_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev_ctx,
struct resolv_ctx *ctx;
if (timeout < 1) {
- return EINVAL;
+ DEBUG(SSSDBG_MINOR_FAILURE,
+ ("The timeout is too short, DNS operations are going to fail. "
+ "This is a bug outside unit tests\n"));
}
ctx = talloc_zero(mem_ctx, struct resolv_ctx);
@@ -1389,6 +1391,9 @@ resolv_gethostbyname_done(struct tevent_req *subreq)
/* No more databases and/or address families */
tevent_req_error(req, ENOENT);
return;
+ } else if (ret == ETIMEDOUT) {
+ /* In case we killed the request before c-ares answered */
+ state->status = ARES_ETIMEOUT;
}
if (ret != EOK) {