diff options
author | Philip Hazel <ph10@hermes.cam.ac.uk> | 2004-12-21 13:59:15 +0000 |
---|---|---|
committer | Philip Hazel <ph10@hermes.cam.ac.uk> | 2004-12-21 13:59:15 +0000 |
commit | 3ca0ba97c4bd4f8ece7f38b60280222020c1d024 (patch) | |
tree | 154ebcf7cf669a69c3dbc8431ac2fc9730459a50 /src | |
parent | 7102e136b439b6e92317b484192f1357b1e1121a (diff) |
Improve error message when ldap_search fails in OpenLDAP or Solaris
LDAP.
Diffstat (limited to 'src')
-rw-r--r-- | src/src/lookups/ldap.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/src/lookups/ldap.c b/src/src/lookups/ldap.c index 043135e03..1b5da047d 100644 --- a/src/src/lookups/ldap.c +++ b/src/src/lookups/ldap.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/lookups/ldap.c,v 1.5 2004/12/21 12:00:59 ph10 Exp $ */ +/* $Cambridge: exim/src/src/lookups/ldap.c,v 1.6 2004/12/21 13:59:15 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -560,7 +560,16 @@ msgid = ldap_search(lcp->ld, ludp->lud_dn, ludp->lud_scope, ludp->lud_filter, if (msgid == -1) { - *errmsg = string_sprintf("ldap search initiation failed"); + #if defined LDAP_LIB_SOLARIS || defined LDAP_LIB_OPENLDAP2 + int err; + ldap_get_option(lcp->ld, LDAP_OPT_ERROR_NUMBER, &err); + *errmsg = string_sprintf("ldap_search failed: %d, %s", err, + ldap_err2string(err)); + + #else + *errmsg = string_sprintf("ldap_search failed"); + #endif + goto RETURN_ERROR; } |