]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/sasl.c
Extend checks to substrings rules. Need to kludge around
[openldap] / servers / slapd / sasl.c
index 7481bfb85f6a2ab87dfca0065dab71532e63b610..3430d4ee68015ff84a10df9ab195a4f5fbb0e136 100644 (file)
@@ -32,7 +32,8 @@
 #define        SASL_CONST
 #endif
 
-#include <ldap_pvt.h>
+#include "ldap_pvt.h"
+#include "lber_pvt.h"
 
 /* Flags for telling slap_sasl_getdn() what type of identity is being passed */
 #define FLAG_GETDN_AUTHCID 2
@@ -1113,12 +1114,15 @@ int slap_sasl_init( void )
                return -1;
        }
 #endif
-       
+
+       /* SASL 2 does its own memory management internally */
+#if SASL_VERSION_MAJOR < 2
        sasl_set_alloc(
                ber_memalloc,
                ber_memcalloc,
                ber_memrealloc,
                ber_memfree ); 
+#endif
 
        sasl_set_mutex(
                ldap_pvt_sasl_mutex_new,
@@ -1140,6 +1144,10 @@ int slap_sasl_init( void )
                Debug( LDAP_DEBUG_ANY, "sasl_server_init failed\n",
                        0, 0, 0 );
 #endif
+#if SASL_VERSION_MAJOR < 2
+               /* A no-op used to make sure we linked with Cyrus 1.5 */
+               sasl_client_auth( NULL, NULL, NULL, 0, NULL, NULL );
+#endif
 
                return -1;
        }