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:53 -0400
commitbd0dad92d8cd37f9c710741a33820368d9a831c5 (patch)
tree1122068e6452c7fe0162477435982909896c00dd /src/resolv
parent65d27fde2412d5c39ed80f3d1b75b5a59e2fb1c8 (diff)
downloadsssd-bd0dad92d8cd37f9c710741a33820368d9a831c5.tar.gz
sssd-bd0dad92d8cd37f9c710741a33820368d9a831c5.tar.xz
sssd-bd0dad92d8cd37f9c710741a33820368d9a831c5.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) {