summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/sdap_id_op.c
diff options
context:
space:
mode:
authorJan Zeleny <jzeleny@redhat.com>2011-03-11 11:51:34 -0500
committerStephen Gallagher <sgallagh@redhat.com>2011-03-14 15:42:36 -0400
commit45a1a6d68af7a22a13f046855c59329221667448 (patch)
tree6356e615d48adae03b942f5bad5069cb605a45ec /src/providers/ldap/sdap_id_op.c
parentb46a9e1db77faceece974575e236da76dae3c159 (diff)
downloadsssd-45a1a6d68af7a22a13f046855c59329221667448.tar.gz
sssd-45a1a6d68af7a22a13f046855c59329221667448.tar.xz
sssd-45a1a6d68af7a22a13f046855c59329221667448.zip
Fix one unlikely case of failure in sdap_id_op module
There can be an unlikely scenario when the first part of sdap_id_op_connect_done works fine and there is no need to mark backend offline. But right after the check, the memory allocation can fail in which case the backend needs to be marked offline along with disabled reconnecting.
Diffstat (limited to 'src/providers/ldap/sdap_id_op.c')
-rw-r--r--src/providers/ldap/sdap_id_op.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/providers/ldap/sdap_id_op.c b/src/providers/ldap/sdap_id_op.c
index c38a803ff..6933b2bb2 100644
--- a/src/providers/ldap/sdap_id_op.c
+++ b/src/providers/ldap/sdap_id_op.c
@@ -522,7 +522,7 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq)
/* be is going offline as there is no more servers to try */
DEBUG(1, ("Failed to connect, going offline (%d [%s])\n",
ret, strerror(ret)));
- be_mark_offline(conn_data->conn_cache->id_ctx->be);
+ be_mark_offline(conn_cache->id_ctx->be);
is_offline = true;
}
@@ -544,6 +544,8 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq)
default:
/* do not attempt to retry on errors like ENOMEM */
can_retry = false;
+ is_offline = true;
+ be_mark_offline(conn_cache->id_ctx->be);
break;
}
}