From 255b3f04e7e91a0fbed79b28e53ac3a432916efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Thu, 8 Jul 2004 14:29:20 +0000 Subject: [PATCH] (LDAP_seq): try handling errors better git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14031 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hdb/hdb-ldap.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/hdb/hdb-ldap.c b/lib/hdb/hdb-ldap.c index 313bb629f..7c29ed13e 100644 --- a/lib/hdb/hdb-ldap.c +++ b/lib/hdb/hdb-ldap.c @@ -1316,6 +1316,10 @@ LDAP_seq(krb5_context context, HDB * db, unsigned flags, hdb_entry * entry) do { rc = ldap_result(HDB2LDAP(db), msgid, LDAP_MSG_ONE, NULL, &e); switch (rc) { + case LDAP_RES_SEARCH_REFERENCE: + ldap_msgfree(e); + ret = 0; + break; case LDAP_RES_SEARCH_ENTRY: /* We have an entry. Parse it. */ ret = LDAP_message2entry(context, db, e, entry); @@ -1336,10 +1340,11 @@ LDAP_seq(krb5_context context, HDB * db, unsigned flags, hdb_entry * entry) HDBSETMSGID(db, -1); break; case LDAP_SERVER_DOWN: + ldap_msgfree(e); LDAP_close(context, db); - /* fall though */ - case 0: - case -1: + HDBSETMSGID(db, -1); + ret = ENETDOWN; + break; default: /* Some unspecified error (timeout?). Abandon. */ ldap_msgfree(e);