[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#4373) bdb dbhome used before init, SEGVs



Full_Name: Aaron Richton
Version: RE23 CVS
OS: Solaris 9
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (128.6.31.135)


Move up the initializer a bit, please:

--- init.c~     Wed Jan 25 11:07:38 2006
+++ init.c      Wed Jan 25 11:09:13 2006
@@ -219,6 +219,14 @@
                goto fail;
        }

+#ifdef HAVE_EBCDIC
+        strcpy( path, bdb->bi_dbenv_home );
+        __atoe( path );
+        dbhome = path;
+#else
+        dbhome = bdb->bi_dbenv_home;
+#endif
+
        /* If existing environment is clean but doesn't support
         * currently requested modes, remove it.
         */
@@ -261,14 +269,6 @@

 #define        BDB_TXN_FLAGS   (DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_TXN)

-#ifdef HAVE_EBCDIC
-       strcpy( path, bdb->bi_dbenv_home );
-       __atoe( path );
-       dbhome = path;
-#else
-       dbhome = bdb->bi_dbenv_home;
-#endif
-
        Debug( LDAP_DEBUG_TRACE,
                "bdb_db_open: dbenv_open(%s)\n",
                bdb->bi_dbenv_home, 0, 0);