]> git.sur5r.net Git - openldap/commitdiff
Import ITS#2019 fix from HEAD (gethostbyname mutex init)
authorHoward Chu <hyc@openldap.org>
Mon, 26 Aug 2002 08:56:59 +0000 (08:56 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 26 Aug 2002 08:56:59 +0000 (08:56 +0000)
libraries/libldap/init.c

index dea29f67d3bb6f65d92898db3a86d3fa19ae8ede..0da9d04b638efe949735d27ba4247098e543d1cc 100644 (file)
@@ -253,7 +253,7 @@ static void openldap_ldap_init_w_userconf(const char *file)
        if (home != NULL) {
                Debug(LDAP_DEBUG_TRACE, "ldap_init: HOME env is %s\n",
                      home, 0, 0);
-               path = LDAP_MALLOC(strlen(home) + strlen(file) + 3);
+               path = LDAP_MALLOC(strlen(home) + strlen(file) + sizeof( LDAP_DIRSEP "."));
        } else {
                Debug(LDAP_DEBUG_TRACE, "ldap_init: HOME env is NULL\n",
                      0, 0, 0);
@@ -263,11 +263,11 @@ static void openldap_ldap_init_w_userconf(const char *file)
                /* we assume UNIX path syntax is used... */
 
                /* try ~/file */
-               sprintf(path, "%s%s%s", home, LDAP_DIRSEP, file);
+               sprintf(path, "%s" LDAP_DIRSEP "%s", home, file);
                openldap_ldap_init_w_conf(path, 1);
 
                /* try ~/.file */
-               sprintf(path, "%s%s.%s", home, LDAP_DIRSEP, file);
+               sprintf(path, "%s" LDAP_DIRSEP ".%s", home, file);
                openldap_ldap_init_w_conf(path, 1);
        }
 
@@ -476,12 +476,12 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
 }
 #endif
 
+       ldap_int_utils_init();
+
 #if defined(LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND) \
        || defined(HAVE_TLS) || defined(HAVE_CYRUS_SASL)
        ldap_int_hostname = ldap_pvt_get_fqdn( ldap_int_hostname );
 #endif
-       ldap_int_utils_init();
-
        if ( ldap_int_tblsize == 0 )
                ldap_int_ip_init();