]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Fix LDAP SASL support
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 2 Jun 2025 17:42:03 +0000 (20:42 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 17 Jun 2025 04:58:56 +0000 (04:58 +0000)
The settings code didn't see the necessary defines.

Based on patch by Jakob Haufe

Broken by 961275fdb54878fdfa4ee1b9f1a4f00e82bf4a83

src/auth/db-ldap-settings.h
src/auth/db-ldap.c

index dc341dd3943cba79080bf8040f68f64aaece7dfb..a5f2d09fa38ba722d6b26d41f16316809c67f1f8 100644 (file)
@@ -1,6 +1,20 @@
 #ifndef DB_LDAP_SETTINGS_H
 #define DB_LDAP_SETTINGS_H
 
+/* <settings checks> */
+#define HAVE_LDAP_SASL
+#ifdef HAVE_SASL_SASL_H
+#  include <sasl/sasl.h>
+#elif defined (HAVE_SASL_H)
+#  include <sasl.h>
+#else
+#  undef HAVE_LDAP_SASL
+#endif
+#if !defined(SASL_VERSION_MAJOR) || SASL_VERSION_MAJOR < 2
+#  undef HAVE_LDAP_SASL
+#endif
+/* </settings checks> */
+
 enum db_ldap_lookup_type {
        DB_LDAP_LOOKUP_TYPE_PASSDB,
        DB_LDAP_LOOKUP_TYPE_USERDB,
index 9dcebedd57e8a90fe3b337a8808df07f6b124cf6..302faf38f43eca5b4be1664e66bd45ce680a17b6 100644 (file)
 
 #include <unistd.h>
 
-#define HAVE_LDAP_SASL
-#ifdef HAVE_SASL_SASL_H
-#  include <sasl/sasl.h>
-#elif defined (HAVE_SASL_H)
-#  include <sasl.h>
-#else
-#  undef HAVE_LDAP_SASL
-#endif
 #ifdef LDAP_OPT_X_TLS
 #  define OPENLDAP_TLS_OPTIONS
 #endif
-#if !defined(SASL_VERSION_MAJOR) || SASL_VERSION_MAJOR < 2
-#  undef HAVE_LDAP_SASL
-#endif
 
 #ifndef LDAP_SASL_QUIET
 #  define LDAP_SASL_QUIET 0 /* Doesn't exist in Solaris LDAP */