7 #include "proto-slap.h"
12 char **supportedSASLMechanisms = NULL;
14 #ifdef HAVE_CYRUS_SASL
22 sasl_conn_t *server = NULL;
24 rc = sasl_server_init( NULL, "slapd" );
27 Debug( LDAP_DEBUG_ANY, "sasl_server_init failed\n",
32 rc = sasl_server_new( "ldap", NULL, NULL, NULL,
37 Debug( LDAP_DEBUG_ANY, "sasl_server_new failed\n",
44 sasl_security_properties_t secprops;
45 memset(&secprops, 0, sizeof(secprops));
46 secprops.security_flags = SASL_SEC_NOPLAINTEXT | SASL_SEC_NOANONYMOUS;
47 secprops.property_names = NULL;
48 secprops.property_values = NULL;
50 rc = sasl_setprop( server, SASL_SEC_PROPS, &secprops );
53 Debug( LDAP_DEBUG_ANY, "sasl_setprop failed\n",
60 rc = sasl_listmech( server, NULL, NULL, ",", NULL,
64 Debug( LDAP_DEBUG_ANY, "sasl_listmech failed: %d\n",
69 Debug( LDAP_DEBUG_TRACE, "SASL mechanisms: %s\n",
72 supportedSASLMechanisms = str2charray( data, "," );
73 sasl_dispose( &server );
78 int sasl_destroy( void )
80 charray_free( supportedSASLMechanisms );
86 int sasl_init( void ) { return 0; }
87 int sasl_destroy( void ) { return 0; }