dovecot-2.0: LDAP: If LDAP_OPT_ERROR_STRING gives more informati...

dovecot at dovecot.org dovecot at dovecot.org
Tue May 12 20:46:20 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/11b6aab8a203
changeset: 9264:11b6aab8a203
user:      Timo Sirainen <tss at iki.fi>
date:      Tue May 12 13:45:08 2009 -0400
description:
LDAP: If LDAP_OPT_ERROR_STRING gives more information, log it.

diffstat:

1 file changed, 12 insertions(+), 1 deletion(-)
src/auth/db-ldap.c |   13 ++++++++++++-

diffs (23 lines):

diff -r 5d0a69504867 -r 11b6aab8a203 src/auth/db-ldap.c
--- a/src/auth/db-ldap.c	Mon May 11 20:10:30 2009 -0400
+++ b/src/auth/db-ldap.c	Tue May 12 13:45:08 2009 -0400
@@ -206,7 +206,18 @@ static int ldap_get_errno(struct ldap_co
 
 const char *ldap_get_error(struct ldap_connection *conn)
 {
-	return ldap_err2string(ldap_get_errno(conn));
+	const char *ret;
+	char *str = NULL;
+
+	ret = ldap_err2string(ldap_get_errno(conn));
+
+	ldap_get_option(conn->ld, LDAP_OPT_ERROR_STRING, (void *)&str);
+	if (str != NULL) {
+		ret = t_strconcat(ret, ", ", str, NULL);
+		ldap_memfree(str);
+	}
+	ldap_set_option(conn->ld, LDAP_OPT_ERROR_STRING, NULL);
+	return ret;
 }
 
 static void ldap_conn_reconnect(struct ldap_connection *conn)


More information about the dovecot-cvs mailing list