8 #include "proto-slap.h"
15 #define Debug(x,s,a,b,c) fprintf(stderr, s, a, b, c)
20 /* sasl server context */
21 static sasl_conn_t *server = NULL;
28 sasl_security_properties_t secprops;
30 rc = sasl_server_init( NULL, "slapd" );
33 Debug( LDAP_DEBUG_ANY, "sasl_server_init failed\n",
38 rc = sasl_server_new( "ldap", NULL, NULL, NULL,
43 Debug( LDAP_DEBUG_ANY, "sasl_server_new failed\n",
48 memset(&secprops, 0, sizeof(secprops));
49 secprops.security_flags = SASL_SEC_NOPLAINTEXT | SASL_SEC_NOANONYMOUS;
50 secprops.property_names = NULL;
51 secprops.property_values = NULL;
53 rc = sasl_setprop( server, SASL_SEC_PROPS, &secprops );
56 Debug( LDAP_DEBUG_ANY, "sasl_setprop failed\n",
61 rc = sasl_listmech( server, NULL, NULL, ",", NULL,
65 Debug( LDAP_DEBUG_ANY, "sasl_listmech failed: %d\n",
70 Debug( LDAP_DEBUG_TRACE, "SASL mechanisms: %s\n",
76 int sasl_destory( void )
78 if( server != NULL ) {
79 sasl_dispose( &server );
84 int main( int argc, char* argv[] )