[dovecot-cvs] dovecot/src/auth db-ldap.c,1.21,1.22

cras at dovecot.org cras at dovecot.org
Fri Jul 16 19:20:57 EEST 2004


Update of /home/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv15839/src/auth

Modified Files:
	db-ldap.c 
Log Message:
Fixed to compile with Solaris LDAP library



Index: db-ldap.c
===================================================================
RCS file: /home/cvs/dovecot/src/auth/db-ldap.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- db-ldap.c	25 Apr 2004 22:40:29 -0000	1.21
+++ db-ldap.c	16 Jul 2004 16:20:55 -0000	1.22
@@ -21,6 +21,11 @@
 #  define OPENLDAP_ASYNC_WORKAROUND
 #endif
 
+/* Solaris LDAP library doesn't have LDAP_OPT_SUCCESS */
+#ifndef LDAP_OPT_SUCCESS
+#  define LDAP_OPT_SUCCESS LDAP_SUCCESS
+#endif
+
 #define DEF(type, name) \
 	{ type, #name, offsetof(struct ldap_settings, name) }
 
@@ -181,8 +186,13 @@
 
 	if (conn->ld == NULL) {
 		if (conn->set.uris != NULL) {
+#ifdef LDAP_HAVE_INITIALIZE
 			if (ldap_initialize(&conn->ld, conn->set.uris) != LDAP_SUCCESS)
 				conn->ld = NULL;
+#else
+			i_fatal("LDAP: Your LDAP library doesn't support "
+				"'uris' setting, use 'hosts' instead.");
+#endif
 		} else
 			conn->ld = ldap_init(conn->set.hosts, LDAP_PORT);
 



More information about the dovecot-cvs mailing list