dovecot: Die if (Solaris) LDAP library returns wrong file descri...

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


details:   http://hg.dovecot.org/dovecot/rev/3069e66789b3
changeset: 6873:3069e66789b3
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Nov 28 16:08:39 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 082526b2702e -r 3069e66789b3 src/auth/db-ldap.c
--- a/src/auth/db-ldap.c	Wed Nov 28 15:50:55 2007 +0200
+++ b/src/auth/db-ldap.c	Wed Nov 28 16:08:39 2007 +0200
@@ -527,6 +527,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