dovecot-1.0: Fail with a clear error if both tls=yes and ldaps:/...

dovecot at dovecot.org dovecot at dovecot.org
Wed Mar 5 01:11:00 EET 2008


details:   http://hg.dovecot.org/dovecot-1.0/rev/c81845f90020
changeset: 5530:c81845f90020
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Mar 05 01:10:57 2008 +0200
description:
Fail with a clear error if both tls=yes and ldaps:// URI is used.

diffstat:

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

diffs (15 lines):

diff -r 50be791dc276 -r c81845f90020 src/auth/db-ldap.c
--- a/src/auth/db-ldap.c	Wed Mar 05 00:56:28 2008 +0200
+++ b/src/auth/db-ldap.c	Wed Mar 05 01:10:57 2008 +0200
@@ -573,6 +573,11 @@ int db_ldap_connect(struct ldap_connecti
 #ifdef LDAP_HAVE_START_TLS_S
 		ret = ldap_start_tls_s(conn->ld, NULL, NULL);
 		if (ret != LDAP_SUCCESS) {
+			if (ret == LDAP_OPERATIONS_ERROR &&
+			    strncmp(conn->set.uris, "ldaps:", 6) == 0) {
+				i_fatal("LDAP: Don't use both tls=yes "
+					"and ldaps URI");
+			}
 			i_error("LDAP: ldap_start_tls_s() failed: %s",
 				ldap_err2string(ret));
 			return -1;


More information about the dovecot-cvs mailing list