From: Howard Chu Date: Thu, 25 Jan 2007 12:16:55 +0000 (+0000) Subject: Plug global_host race condition/leak X-Git-Tag: OPENLDAP_REL_ENG_2_4_4ALPHA~8^2~135 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ba68a94f113f4b272b955174795a212211d713f9;p=openldap Plug global_host race condition/leak --- diff --git a/servers/slapd/main.c b/servers/slapd/main.c index 994f9fcfa9..1b653c6d51 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -830,6 +830,12 @@ unhandled_option:; } #endif +#ifdef HAVE_CYRUS_SASL + if( global_host == NULL ) { + global_host = ldap_pvt_get_fqdn( NULL ); + } +#endif + (void) SIGNAL( LDAP_SIGUSR1, slap_sig_wake ); (void) SIGNAL( LDAP_SIGUSR2, slap_sig_shutdown ); diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index 756522bde5..0cd5afca9a 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -1138,10 +1138,6 @@ int slap_sasl_open( Connection *conn, int reopen ) conn->c_sasl_layers = 0; - if( global_host == NULL ) { - global_host = ldap_pvt_get_fqdn( NULL ); - } - /* create new SASL context */ #if SASL_VERSION_MAJOR >= 2 if ( conn->c_sock_name.bv_len != 0 &&