aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2001-11-15 08:23:11 +0800
committerChris Toshok <toshok@src.gnome.org>2001-11-15 08:23:11 +0800
commitae879d7443335c54ac85761b0abc6f9b13aa2f94 (patch)
treedbda89d3d8c2ec745bb278ac59da1ce2b2f38795 /addressbook
parente8d02483a8de59136aebe9fe277677d045cd10f4 (diff)
downloadgsoc2013-evolution-ae879d7443335c54ac85761b0abc6f9b13aa2f94.tar
gsoc2013-evolution-ae879d7443335c54ac85761b0abc6f9b13aa2f94.tar.gz
gsoc2013-evolution-ae879d7443335c54ac85761b0abc6f9b13aa2f94.tar.bz2
gsoc2013-evolution-ae879d7443335c54ac85761b0abc6f9b13aa2f94.tar.lz
gsoc2013-evolution-ae879d7443335c54ac85761b0abc6f9b13aa2f94.tar.xz
gsoc2013-evolution-ae879d7443335c54ac85761b0abc6f9b13aa2f94.tar.zst
gsoc2013-evolution-ae879d7443335c54ac85761b0abc6f9b13aa2f94.zip
check against LDAP_SUCCESS as the return value, not -1.
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. svn path=/trunk/; revision=14724
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog7
-rw-r--r--addressbook/backend/pas/pas-backend-ldap.c16
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);