]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9787 init global_host earlier so tools see it too
authorHoward Chu <hyc@openldap.org>
Sun, 23 Jan 2022 14:07:43 +0000 (14:07 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 23 Jan 2022 14:08:24 +0000 (14:08 +0000)
servers/slapd/main.c

index 10440a489418f68dc9a440862255fa3ea158c151..a9e69b01a11cb6e0cd51955cbc68cf2c6d5dd591 100644 (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 );