dovecot-1.0: Die if (Solaris) LDAP library returns wrong file de...

dovecot at dovecot.org dovecot at dovecot.org
Wed Nov 28 16:08:47 EET 2007


details:   http://hg.dovecot.org/dovecot-1.0/rev/1231f0e646f4
changeset: 5465:1231f0e646f4
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Nov 28 16:08:43 2007 +0200
description:
Die if (Solaris) LDAP library returns wrong file descriptor.

diffstat:

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

diffs (15 lines):

diff -r edd95f9c6ba4 -r 1231f0e646f4 src/auth/db-ldap.c
--- a/src/auth/db-ldap.c	Wed Nov 28 08:11:17 2007 +0200
+++ b/src/auth/db-ldap.c	Wed Nov 28 16:08:43 2007 +0200
@@ -513,6 +513,11 @@ static void db_ldap_get_fd(struct ldap_c
 		i_fatal("LDAP: Can't get connection fd: %s",
 			ldap_err2string(ret));
 	}
+	if (conn->fd <= CLIENT_LISTEN_FD) {
+		/* Solaris LDAP library seems to be broken */
+		i_fatal("LDAP: Buggy LDAP library returned wrong fd: %d",
+			conn->fd);
+	}
 	i_assert(conn->fd != -1);
 	net_set_nonblock(conn->fd, TRUE);
 }


More information about the dovecot-cvs mailing list