summaryrefslogtreecommitdiffstats
path: root/server/providers/ldap/ldap_auth.c
diff options
context:
space:
mode:
authorMartin Nagy <mnagy@redhat.com>2009-12-10 22:23:04 +0100
committerStephen Gallagher <sgallagh@redhat.com>2009-12-15 07:23:57 -0500
commitd52617ca1c217327bcb8dc53fa67e329f550a667 (patch)
treefbc93623bb419e98e6b7e1acfe3eeb3e0d766ef9 /server/providers/ldap/ldap_auth.c
parentefb68a421a4cd8dbccc7fb60d5fcd5aa3a00ca30 (diff)
downloadsssd-d52617ca1c217327bcb8dc53fa67e329f550a667.tar.gz
sssd-d52617ca1c217327bcb8dc53fa67e329f550a667.tar.xz
sssd-d52617ca1c217327bcb8dc53fa67e329f550a667.zip
Don't consider one address with different port numbers as the same
There were two problems with the code. We were using fo_set_server_status() instead of fo_set_port_status() when we failed to connect to a service. This is a problem because if two services use the same server, or we want to use one server with two different ports, marking the whole server as bad is incorrect. The other problem was that be_resolve_server_done() was comparing the hostent structures -- these are, however, equal across multiple server:port pairs with the same server addresses. Fixes: #321
Diffstat (limited to 'server/providers/ldap/ldap_auth.c')
-rw-r--r--server/providers/ldap/ldap_auth.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/providers/ldap/ldap_auth.c b/server/providers/ldap/ldap_auth.c
index 81c966662..88e637b09 100644
--- a/server/providers/ldap/ldap_auth.c
+++ b/server/providers/ldap/ldap_auth.c
@@ -513,12 +513,14 @@ static void auth_connect_done(struct tevent_req *subreq)
talloc_zfree(subreq);
if (ret) {
if (state->srv) {
- /* mark the server as bad if connection failed */
- fo_set_server_status(state->srv, SERVER_NOT_WORKING);
+ /* mark this server as bad if connection failed */
+ fo_set_port_status(state->srv, PORT_NOT_WORKING);
}
tevent_req_error(req, ret);
return;
+ } else if (state->srv) {
+ fo_set_port_status(state->srv, PORT_WORKING);
}
subreq = get_user_dn_send(state, state->ev,