]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/init.c
Add O_EXCL
[openldap] / libraries / libldap / init.c
index c6b68759823304508494be73f768def571f82827..96e7b8f3dc9f67be7a18bb108a3c23902bb831e0 100644 (file)
@@ -116,8 +116,8 @@ static void openldap_ldap_init_w_conf(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "init", LDAP_LEVEL_DETAIL1, 
-               "openldap_init_w_conf: trying %s\n", file ));
+       LDAP_LOG ( CONFIG, DETAIL1, 
+               "openldap_init_w_conf: trying %s\n", file, 0, 0 );
 #else
        Debug(LDAP_DEBUG_TRACE, "ldap_init: trying %s\n", file, 0, 0);
 #endif
@@ -129,8 +129,7 @@ static void openldap_ldap_init_w_conf(
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "init", LDAP_LEVEL_DETAIL1, 
-               "openldap_init_w_conf: using %s\n", file ));
+       LDAP_LOG ( CONFIG, DETAIL1, "openldap_init_w_conf: using %s\n", file, 0, 0 );
 #else
        Debug(LDAP_DEBUG_TRACE, "ldap_init: using %s\n", file, 0, 0);
 #endif
@@ -262,17 +261,17 @@ static void openldap_ldap_init_w_userconf(const char *file)
 
        if (home != NULL) {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "init", LDAP_LEVEL_ARGS, 
-               "openldap_init_w_userconf: HOME env is %s\n", home ));
+       LDAP_LOG ( CONFIG, ARGS, 
+               "openldap_init_w_userconf: HOME env is %s\n", home, 0, 0 );
 #else
                Debug(LDAP_DEBUG_TRACE, "ldap_init: HOME env is %s\n",
                      home, 0, 0);
 #endif
-               path = LDAP_MALLOC(strlen(home) + strlen(file) + 3);
+               path = LDAP_MALLOC(strlen(home) + strlen(file) + sizeof( LDAP_DIRSEP "."));
        } else {
 #ifdef NEW_LOGGING
-       LDAP_LOG (( "init", LDAP_LEVEL_ARGS, 
-               "openldap_init_w_userconf: HOME env is NULL\n" ));
+       LDAP_LOG ( CONFIG, ARGS, "openldap_init_w_userconf: HOME env is NULL\n",
+               0, 0, 0 );
 #else
                Debug(LDAP_DEBUG_TRACE, "ldap_init: HOME env is NULL\n",
                      0, 0, 0);
@@ -283,11 +282,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);
        }
 
@@ -555,9 +554,9 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
 
                if( altfile != NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "init", LDAP_LEVEL_DETAIL1, 
+                       LDAP_LOG ( CONFIG, DETAIL1, 
                                "openldap_init_w_userconf: %sCONF env is %s\n",
-                               LDAP_ENV_PREFIX, altfile ));
+                               LDAP_ENV_PREFIX, altfile, 0 );
 #else
                        Debug(LDAP_DEBUG_TRACE, "ldap_init: %s env is %s\n",
                              LDAP_ENV_PREFIX "CONF", altfile, 0);
@@ -566,9 +565,9 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
                }
                else
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "init", LDAP_LEVEL_DETAIL1, 
+                       LDAP_LOG ( CONFIG, DETAIL1, 
                                "openldap_init_w_userconf: %sCONF env is NULL\n",
-                               LDAP_ENV_PREFIX ));
+                               LDAP_ENV_PREFIX, 0, 0 );
 #else
                        Debug(LDAP_DEBUG_TRACE, "ldap_init: %s env is NULL\n",
                              LDAP_ENV_PREFIX "CONF", 0, 0);
@@ -580,9 +579,9 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
 
                if( altfile != NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "init", LDAP_LEVEL_DETAIL1, 
+                       LDAP_LOG ( CONFIG, DETAIL1, 
                                "openldap_init_w_userconf: %sRC env is %s\n",
-                               LDAP_ENV_PREFIX, altfile ));
+                               LDAP_ENV_PREFIX, altfile, 0 );
 #else
                        Debug(LDAP_DEBUG_TRACE, "ldap_init: %s env is %s\n",
                              LDAP_ENV_PREFIX "RC", altfile, 0);
@@ -591,9 +590,9 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
                }
                else
 #ifdef NEW_LOGGING
-                       LDAP_LOG (( "init", LDAP_LEVEL_DETAIL1, 
+                       LDAP_LOG ( CONFIG, DETAIL1, 
                                "openldap_init_w_userconf: %sRC env is NULL\n",
-                               LDAP_ENV_PREFIX ));
+                               LDAP_ENV_PREFIX, 0, 0 );
 #else
                        Debug(LDAP_DEBUG_TRACE, "ldap_init: %s env is NULL\n",
                              LDAP_ENV_PREFIX "RC", 0, 0);