9 #include "proto-slap.h"
16 #define Debug(x,s,a,b,c) fprintf(stderr, s, a, b, c)
21 /* sasl server context */
22 static sasl_conn_t *server = NULL;
29 sasl_security_properties_t secprops;
31 rc = sasl_server_init( NULL, "slapd" );
34 Debug( LDAP_DEBUG_ANY, "sasl_server_init failed\n",
39 rc = sasl_server_new( "ldap", NULL, NULL, NULL,
44 Debug( LDAP_DEBUG_ANY, "sasl_server_new failed\n",
49 memset(&secprops, 0, sizeof(secprops));
50 secprops.security_flags = SASL_SEC_NOPLAINTEXT | SASL_SEC_NOANONYMOUS;
51 secprops.property_names = NULL;
52 secprops.property_values = NULL;
54 rc = sasl_setprop( server, SASL_SEC_PROPS, &secprops );
57 Debug( LDAP_DEBUG_ANY, "sasl_setprop failed\n",
62 rc = sasl_listmech( server, NULL, NULL, ",", NULL,
66 Debug( LDAP_DEBUG_ANY, "sasl_listmech failed: %d\n",
71 Debug( LDAP_DEBUG_TRACE, "SASL mechanisms: %s\n",
77 int sasl_destory( void )
79 if( server != NULL ) {
80 sasl_dispose( &server );
85 int main( int argc, char* argv[] )