diff options
-rw-r--r-- | addressbook/ChangeLog | 7 | ||||
-rw-r--r-- | addressbook/backend/pas/pas-backend-ldap.c | 16 |
2 files changed, 16 insertions, 7 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index b14a744509..2a3198e7a8 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,10 @@ +2001-11-14 Chris Toshok <toshok@ximian.com> + + * backend/pas/pas-backend-ldap.c (search_for_dn): check against + LDAP_SUCCESS as the return value, not -1. + (pas_backend_ldap_build_all_cards_list): same. + (pas_backend_ldap_process_authenticate_user): same. + 2001-11-12 Chris Toshok <toshok@ximian.com> [ Fixes Ximian bug #14843 ] diff --git a/addressbook/backend/pas/pas-backend-ldap.c b/addressbook/backend/pas/pas-backend-ldap.c index 0618f43092..3cec815753 100644 --- a/addressbook/backend/pas/pas-backend-ldap.c +++ b/addressbook/backend/pas/pas-backend-ldap.c @@ -435,7 +435,7 @@ search_for_dn (PASBackendLDAP *bl, const char *dn) dn, LDAP_SCOPE_BASE, "(objectclass=*)", - NULL, 0, &res) != -1) { + NULL, 0, &res) == LDAP_SUCCESS) { e = ldap_first_entry (ldap, res); while (NULL != e) { if (!strcmp (ldap_get_dn (ldap, e), dn)) { @@ -1285,7 +1285,7 @@ pas_backend_ldap_build_all_cards_list(PASBackend *backend, bl->priv->ldap_rootdn, bl->priv->ldap_scope, "(objectclass=*)", - NULL, 0, &res)) == -1) { + NULL, 0, &res)) != LDAP_SUCCESS) { g_warning ("ldap error '%s' in " "pas_backend_ldap_build_all_cards_list\n", ldap_err2string(ldap_error)); @@ -2360,11 +2360,13 @@ pas_backend_ldap_process_authenticate_user (PASBackend *backend, query = g_strdup_printf ("(mail=%s)", req->user); - if (ldap_search_s (bl->priv->ldap, - bl->priv->ldap_rootdn, - bl->priv->ldap_scope, - query, - NULL, 0, &res) != -1) { + ldap_error = ldap_search_s (bl->priv->ldap, + bl->priv->ldap_rootdn, + bl->priv->ldap_scope, + query, + NULL, 0, &res); + + if (ldap_error == LDAP_SUCCESS) { char *dn; e = ldap_first_entry (bl->priv->ldap, res); |