summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2010-11-19 14:33:05 +0100
committerStephen Gallagher <sgallagh@redhat.com>2010-11-19 13:52:23 -0500
commit488f1784198a0a8775d7f5bb9e960d80a833ba73 (patch)
tree39167be560b4d188c3cfa292c43aeeb3981ebccc
parentb853b135b9dfa315973faff706eb32aa36b5934a (diff)
downloadsssd-488f1784198a0a8775d7f5bb9e960d80a833ba73.tar.gz
sssd-488f1784198a0a8775d7f5bb9e960d80a833ba73.tar.xz
sssd-488f1784198a0a8775d7f5bb9e960d80a833ba73.zip
Fix offline detection for LDAP auth/chpass
-rw-r--r--src/providers/ldap/ldap_auth.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/providers/ldap/ldap_auth.c b/src/providers/ldap/ldap_auth.c
index 4a4bfe17f..57a549d8d 100644
--- a/src/providers/ldap/ldap_auth.c
+++ b/src/providers/ldap/ldap_auth.c
@@ -567,8 +567,7 @@ static void auth_resolve_done(struct tevent_req *subreq)
if (ret) {
/* all servers have been tried and none
* was found good, go offline */
- state->result = SDAP_UNAVAIL;
- tevent_req_done(req);
+ tevent_req_error(req, ETIMEDOUT);
return;
}
@@ -667,9 +666,13 @@ int auth_recv(struct tevent_req *req,
if (tevent_req_is_error(req, &tstate, &err)) {
switch (tstate) {
case TEVENT_REQ_USER_ERROR:
- if (err == ETIMEDOUT) *result = SDAP_UNAVAIL;
- else *result = SDAP_ERROR;
- return err;
+ if (err == ETIMEDOUT) {
+ *result = SDAP_UNAVAIL;
+ return EOK;
+ } else {
+ *result = SDAP_ERROR;
+ return err;
+ }
default:
*result = SDAP_ERROR;
return EIO;
@@ -878,6 +881,11 @@ static void sdap_auth4chpass_done(struct tevent_req *req)
case SDAP_AUTH_FAILED:
state->pd->pam_status = PAM_AUTH_ERR;
break;
+ case SDAP_UNAVAIL:
+ state->pd->pam_status = PAM_AUTHINFO_UNAVAIL;
+ be_mark_offline(state->breq->be_ctx);
+ dp_err = DP_ERR_OFFLINE;
+ break;
default:
state->pd->pam_status = PAM_SYSTEM_ERR;
}