]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/main.c
Cleanup
[openldap] / servers / slapd / main.c
index b22e8b70f139c65beb1c76d52e92689e134126ce..2fc052369b640d1a44e4c9b8223b97f07027689b 100644 (file)
@@ -65,7 +65,7 @@ static struct sockaddr_in     bind_addr;
 
 typedef int (MainFunc) LDAP_P(( int argc, char *argv[] ));
 extern MainFunc slapadd, slapcat, slapdn, slapindex, slappasswd,
-       slaptest, slapauth, slapacl;
+       slaptest, slapauth, slapacl, slapschema;
 
 static struct {
        char *name;
@@ -76,6 +76,7 @@ static struct {
        {"slapdn", slapdn},
        {"slapindex", slapindex},
        {"slappasswd", slappasswd},
+       {"slapschema", slapschema},
        {"slaptest", slaptest},
        {"slapauth", slapauth},
        {"slapacl", slapacl},
@@ -269,7 +270,18 @@ parse_debug_level( const char *arg, int *levelp, char ***unknowns )
                ldap_charray_free( levels );
 
        } else {
-               if ( lutil_atoix( &level, arg, 0 ) != 0 ) {
+               int rc;
+
+               if ( arg[0] == '-' ) {
+                       rc = lutil_atoix( &level, arg, 0 );
+               } else {
+                       unsigned ulevel;
+
+                       rc = lutil_atoux( &ulevel, arg, 0 );
+                       level = (int)ulevel;
+               }
+
+               if ( rc ) {
                        fprintf( stderr,
                                "unrecognized log level "
                                "\"%s\"\n", arg );
@@ -699,6 +711,7 @@ unhandled_option:;
        Debug( LDAP_DEBUG_ANY, "%s", Versionstr, 0, 0 );
 
        global_host = ldap_pvt_get_fqdn( NULL );
+       ber_str2bv( global_host, 0, 0, &global_host_bv );
 
        if( check == CHECK_NONE && slapd_daemon_init( urls ) != 0 ) {
                rc = 1;