mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-07 07:30:57 -05:00
Only bind on TLS port if explicitly requested with -T, otherwise all
kind of conflicts happen when running tests.
This commit is contained in:
parent
5b7babdee4
commit
c18d6e7ecf
2 changed files with 21 additions and 4 deletions
|
|
@ -314,6 +314,8 @@ slapd_daemon_task(
|
|||
|
||||
if( !inetd ) {
|
||||
for ( l = 0; l < N_LISTENERS; l++ ) {
|
||||
if ( listeners[l].tcps < 0 )
|
||||
continue;
|
||||
if ( listen( listeners[l].tcps, 5 ) == -1 ) {
|
||||
int err = errno;
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
|
|
@ -400,6 +402,8 @@ slapd_daemon_task(
|
|||
#endif
|
||||
|
||||
for ( l = 0; l < N_LISTENERS; l++ ) {
|
||||
if ( listeners[l].tcps < 0 )
|
||||
continue;
|
||||
FD_SET( (unsigned) listeners[l].tcps, &readfds );
|
||||
}
|
||||
|
||||
|
|
@ -422,6 +426,8 @@ slapd_daemon_task(
|
|||
#endif
|
||||
|
||||
for ( i = 0; i < N_LISTENERS; i++ ) {
|
||||
if ( listeners[l].tcps < 0 )
|
||||
continue;
|
||||
Debug( LDAP_DEBUG_CONNS,
|
||||
"daemon: select: tcps=%d active_threads=%d tvp=%s\n",
|
||||
listeners[i].tcps, at,
|
||||
|
|
@ -481,6 +487,8 @@ slapd_daemon_task(
|
|||
int len = sizeof(from);
|
||||
long id;
|
||||
|
||||
if ( listeners[l].tcps < 0 )
|
||||
continue;
|
||||
if ( !FD_ISSET( listeners[l].tcps, &readfds ) )
|
||||
continue;
|
||||
|
||||
|
|
|
|||
|
|
@ -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,10 @@ 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;
|
||||
#endif
|
||||
default:
|
||||
usage( argv[0] );
|
||||
|
|
@ -387,9 +392,13 @@ int main( int argc, char **argv )
|
|||
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 );
|
||||
|
|
|
|||
Loading…
Reference in a new issue