]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
LDAP: If LDAP_OPT_ERROR_STRING gives more information, log it.
authorTimo Sirainen <tss@iki.fi>
Tue, 12 May 2009 17:45:08 +0000 (13:45 -0400)
committerTimo Sirainen <tss@iki.fi>
Tue, 12 May 2009 17:45:08 +0000 (13:45 -0400)
--HG--
branch : HEAD

src/auth/db-ldap.c

index e0e8941db4e17863582ef9957ae5baa5e66ad8d4..7c5aceb2e5e8128638fe7f14ab5d9b111d2d6a1d 100644 (file)
@@ -206,7 +206,18 @@ static int ldap_get_errno(struct ldap_connection *conn)
 
 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)