]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/main.c
For dynamic modules, must explicitly zero BackendInfo structure in
[openldap] / servers / slapd / main.c
index a7cae58e9563725bfcf8b655045ce0f4f0b7b293..85f2eababaa6ddfb792366da64559a9f502ffeab 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
 #include "portable.h"
 
 #include <stdio.h>
@@ -101,7 +105,7 @@ usage( char *name )
 #if defined(HAVE_SETUID) && defined(HAVE_SETGID)
                "\t-g group\tGroup (id or name) to ran as\n"
 #endif
-               "\t-h URLs\tList of URLs to serve"
+               "\t-h URLs\tList of URLs to serve\n"
 #ifdef LOG_LOCAL4
                "\t-l sysloguser\tSyslog User (default: LOCAL4)\n"
 #endif
@@ -149,7 +153,11 @@ int main( int argc, char **argv )
        int         serverMode = SLAP_SERVER_MODE;
 
        int port = LDAP_PORT;
+#ifdef HAVE_TLS
        int tls_port = LDAPS_PORT;
+#else
+       int tls_port = 0;
+#endif
 
        g_argc = argc;
        g_argv = argv;
@@ -158,7 +166,6 @@ int main( int argc, char **argv )
        {
                int *i;
                char *newConfigFile;
-               ldap_debug = 0xffff;
                if ( is_NT_Service ) CommenceStartupProcessing( NTservice, slap_set_shutdown );
                i = (int*)getRegParam( NULL, "Port" );
                if ( i != NULL )
@@ -267,7 +274,9 @@ int main( int argc, char **argv )
 
 #ifdef LDAP_CONNECTIONLESS
                case 'c':       /* do connectionless (udp) */
-                       udp = 1;
+                       /* udp = 1; */
+                       fprintf( stderr, "connectionless support not supported");
+                       exit( EXIT_FAILURE );
                        break;
 #endif
 
@@ -320,7 +329,11 @@ int main( int argc, char **argv )
        openlog( serverName, OPENLOG_OPTIONS );
 #endif
 
-       slapd_daemon_init( urls, port, tls_port );
+       if( slapd_daemon_init( urls, port, tls_port ) != 0 ) {
+               rc = 1;
+               SERVICE_EXIT( ERROR_SERVICE_SPECIFIC_ERROR, 16 );
+               goto stop;
+       }
 
 #if defined(HAVE_SETUID) && defined(HAVE_SETGID)
        if ( username != NULL || groupname != NULL ) {