#include <stdio.h>
+#include <ac/ctype.h>
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/time.h>
slap_sl_mem_init();
+ if (( rc = slap_schema_init( )) != 0 ) {
+ Debug( LDAP_DEBUG_ANY,
+ "schema initialization error\n",
+ 0, 0, 0 );
+
+ MAIN_RETURN(rc);
+ }
+
serverName = lutil_progname( "slapd", argc, argv );
if ( strcmp( serverName, "slapd" ) ) {
scp = (struct sync_cookie *) ch_calloc( 1,
sizeof( struct sync_cookie ));
ber_str2bv( optarg, 0, 1, &scp->octet_str );
- slap_parse_sync_cookie( scp );
+ slap_parse_sync_cookie( scp, NULL );
LDAP_STAILQ_FOREACH( scp_entry, &slap_sync_cookie, sc_next ) {
if ( scp->rid == scp_entry->rid ) {
case 'd': /* set debug level and 'do not detach' flag */
no_detach = 1;
#ifdef LDAP_DEBUG
- slap_debug |= atoi( optarg );
+ if ( optarg != NULL && optarg[ 0 ] != '-' && !isdigit( optarg[ 0 ] ) )
+ {
+ int level;
+
+ if ( str2loglevel( optarg, &level ) ) {
+ fprintf( stderr,
+ "unrecognized log level "
+ "\"%s\"\n", optarg );
+ goto destroy;
+ }
+
+ slap_debug |= level;
+ } else {
+ slap_debug |= atoi( optarg );
+ }
#else
if ( atoi( optarg ) != 0 )
fputs( "must compile with LDAP_DEBUG for debugging\n",
}
#endif
- if ( slap_schema_init( ) != 0 ) {
- Debug( LDAP_DEBUG_ANY,
- "schema initialization error\n",
- 0, 0, 0 );
-
- goto destroy;
- }
if ( slap_init( serverMode, serverName ) != 0 ) {
rc = 1;
(void) ldap_pvt_tls_set_option( NULL, LDAP_OPT_X_TLS_REQUIRE_CERT, &rc );
#endif
-#ifdef LDAP_SLAPI
- if ( slapi_int_initialize() != 0 ) {
- Debug( LDAP_DEBUG_ANY,
- "slapi initialization error\n",
- 0, 0, 0 );
-
- goto destroy;
- }
-#endif /* LDAP_SLAPI */
-
if ( frontend_init() ) {
goto destroy;
}