ITS#9787 init global_host earlier so tools see it too

This commit is contained in:
Howard Chu 2022-01-23 14:07:43 +00:00
parent f4e74d51f5
commit 38e16e3b39

View File

@ -275,6 +275,9 @@ int main( int argc, char **argv )
(void) ldap_pvt_tls_set_option( slap_tls_ld, LDAP_OPT_X_TLS_REQUIRE_CERT, &rc );
#endif
global_host = ldap_pvt_get_fqdn( NULL );
ber_str2bv( global_host, 0, 0, &global_host_bv );
serverName = lutil_progname( "slapd", argc, argv );
if ( strcmp( serverName, "slapd" ) ) {
@ -614,9 +617,6 @@ unhandled_option:;
Debug( LDAP_DEBUG_ANY, "%s", Versionstr );
global_host = ldap_pvt_get_fqdn( NULL );
ber_str2bv( global_host, 0, 0, &global_host_bv );
if( check == CHECK_NONE && slapd_daemon_init( urls ) != 0 ) {
rc = 1;
SERVICE_EXIT( ERROR_SERVICE_SPECIFIC_ERROR, 16 );