From ba68a94f113f4b272b955174795a212211d713f9 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 25 Jan 2007 12:16:55 +0000 Subject: [PATCH] Plug global_host race condition/leak --- servers/slapd/main.c | 6 ++++++ servers/slapd/sasl.c | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) 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 && -- 2.39.5