]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/main.c
fix substring_comp_candidates logic if intersection of candidates
[openldap] / servers / slapd / main.c
index 5d818835aad7153caf657ebd15afe7e63ab97f18..d3972ca0f1a0c0088d111bb97262a9d5c05c60c4 100644 (file)
@@ -148,6 +148,7 @@ int main( int argc, char **argv )
 #endif
        char        *serverName;
        int         serverMode = SLAP_SERVER_MODE;
+       int             use_tls_port = 0;
 
        (void) memset( (void*) &bind_addr, '\0', sizeof(bind_addr));
        bind_addr.sin_family = AF_INET;
@@ -209,7 +210,7 @@ int main( int argc, char **argv )
                                 "n:"
 #endif
 #ifdef HAVE_TLS
-                            "P:"
+                            "P:T"
 #endif
                             )) != EOF ) {
                switch ( i ) {
@@ -339,6 +340,11 @@ int main( int argc, char **argv )
                case 'n':  /* NT service name */
                        NTservice = ch_strdup( optarg );
                        break;
+#endif
+#ifdef HAVE_TLS
+               case 'T':  /* Bind on TLS port */
+                       use_tls_port = 1;
+                       break;
 #endif
                default:
                        usage( argv[0] );
@@ -383,13 +389,22 @@ int main( int argc, char **argv )
                goto destroy;
        }
 
+#ifdef HAVE_TLS
+       ldap_pvt_tls_init();
+       ldap_pvt_tls_init_def_ctx();
+#endif
+
        tcps = set_socket( inetd ? NULL : &bind_addr );
        if ( tcps == -1 )
                goto destroy;
 #ifdef HAVE_TLS
-       tls_tcps = set_socket( inetd ? NULL : &tls_bind_addr );
-       if ( tls_tcps == -1 )
-               goto destroy;
+       if ( use_tls_port ) {
+               tls_tcps = set_socket( inetd ? NULL : &tls_bind_addr );
+               if ( tls_tcps == -1 )
+                       goto destroy;
+       } else {
+               tls_tcps = -1;
+       }
 #endif
 
        (void) SIGNAL( LDAP_SIGUSR1, slap_do_nothing );