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

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


details:   http://hg.dovecot.org/dovecot-1.1/rev/0c7dc0b0bb7b
changeset: 7345:0c7dc0b0bb7b
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Mar 05 01:11:00 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 57ae4181bb32 -r 0c7dc0b0bb7b src/auth/db-ldap.c
--- a/src/auth/db-ldap.c	Wed Mar 05 00:57:17 2008 +0200
+++ b/src/auth/db-ldap.c	Wed Mar 05 01:11:00 2008 +0200
@@ -760,6 +760,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