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
This commit is contained in:
Chris Toshok
2001-11-15 00:23:11 +00:00
committed by Chris Toshok
parent e8d02483a8
commit ae879d7443
2 changed files with 16 additions and 7 deletions

View File

@ -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 ]

View File

@ -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);