summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/libsm
diff options
context:
space:
mode:
authorgshapiro <gshapiro@FreeBSD.org>2011-06-14 04:20:18 +0000
committergshapiro <gshapiro@FreeBSD.org>2011-06-14 04:20:18 +0000
commitb73afeb2a402ad777e43387c907da53a40696c88 (patch)
tree76ab24e8fa418fcd903ec416f76b86ad8e8725ff /contrib/sendmail/libsm
parentb8dcfe0228713cd46d96c831843ee6c8bbcb84e3 (diff)
parent8601cea5b1f7986bb1bf047627c2e1c4169d2655 (diff)
downloadFreeBSD-src-b73afeb2a402ad777e43387c907da53a40696c88.zip
FreeBSD-src-b73afeb2a402ad777e43387c907da53a40696c88.tar.gz
Merge sendmail 8.14.5 to HEAD
MFC after: 4 days
Diffstat (limited to 'contrib/sendmail/libsm')
-rw-r--r--contrib/sendmail/libsm/ldap.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/contrib/sendmail/libsm/ldap.c b/contrib/sendmail/libsm/ldap.c
index 7ee57fc..9ae233f 100644
--- a/contrib/sendmail/libsm/ldap.c
+++ b/contrib/sendmail/libsm/ldap.c
@@ -11,7 +11,7 @@
#define LDAP_DEPRECATED 1
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: ldap.c,v 1.83 2009/06/19 22:02:26 guenther Exp $")
+SM_RCSID("@(#)$Id: ldap.c,v 1.85 2011/04/18 22:20:20 ca Exp $")
#if LDAPMAP
# include <sys/types.h>
@@ -1098,10 +1098,8 @@ sm_ldap_results(lmap, msgid, flags, delim, rpool, result,
if (ret == 0)
save_errno = ETIMEDOUT;
- else
+ else if (ret == LDAP_RES_SEARCH_RESULT)
{
- int rc;
-
/*
** We may have gotten an LDAP_RES_SEARCH_RESULT response
** with an error inside it, so we have to extract that
@@ -1109,11 +1107,21 @@ sm_ldap_results(lmap, msgid, flags, delim, rpool, result,
** to an LDAP proxy whose backend has gone down.
*/
- save_errno = ldap_parse_result(lmap->ldap_ld, lmap->ldap_res,
- &rc, NULL, NULL, NULL, NULL, 0);
- if (save_errno == LDAP_SUCCESS)
- save_errno = rc;
+ if (lmap->ldap_res == NULL)
+ save_errno = LDAP_UNAVAILABLE;
+ else
+ {
+ int rc;
+
+ save_errno = ldap_parse_result(lmap->ldap_ld,
+ lmap->ldap_res, &rc, NULL, NULL,
+ NULL, NULL, 0);
+ if (save_errno == LDAP_SUCCESS)
+ save_errno = rc;
+ }
}
+ else
+ save_errno = sm_ldap_geterrno(lmap->ldap_ld);
if (save_errno != LDAP_SUCCESS)
{
statp = EX_TEMPFAIL;
OpenPOWER on IntegriCloud