Bladeren bron

Resolves: #327091
Summary: Migration/Upgrade fails when it's from 6.21 to 8.0 on the same OS/architecture
Description:
back-ldbm.h: added LDBM_VERSION_62
dblayer.c: fixed a bug to check the instance dir name
upgrade.c: added LDBM_VERSION_62

Noriko Hosoi 18 jaren geleden
bovenliggende
commit
14381d4aa4

+ 2 - 2
ldap/servers/slapd/back-ldbm/back-ldbm.h

@@ -157,8 +157,8 @@ typedef unsigned short u_int16_t;
 #define LDBM_VERSION            "Netscape-ldbm/7.0" /* db42: new idl -> old */
 #define LDBM_VERSION_NEW        "Netscape-ldbm/7.0_NEW"     /* db42: new idl */
 #define LDBM_VERSION_OLD        "Netscape-ldbm/7.0_CLASSIC" /* db42: old idl */
-#define LDBM_VERSION_62         "Netscape-ldbm/6.2" /* db33: new idl */
-#define LDBM_VERSION_61         "Netscape-ldbm/6.1" /* db33: new idl */
+#define LDBM_VERSION_62         "Netscape-ldbm/6.2" /* db42: old idl */
+#define LDBM_VERSION_61         "Netscape-ldbm/6.1" /* db33: old idl */
 #define LDBM_VERSION_60         "Netscape-ldbm/6.0" /* db33: old idl */
 
 #define LDBM_VERSION_50			"Netscape-ldbm/5.0"

+ 1 - 1
ldap/servers/slapd/back-ldbm/dblayer.c

@@ -5848,7 +5848,7 @@ int dblayer_update_db_ext(ldbm_instance *inst, char *oldext, char *newext)
     li = inst->inst_li;
     priv = (dblayer_private*)li->li_dblayer_private;
     inst_dirp = dblayer_get_full_inst_dir(li, inst, inst_dir, MAXPATHLEN);
-    if (!inst_dirp || *inst_dirp) {
+    if (NULL == inst_dirp || '\0' == *inst_dirp) {
         LDAPDebug(LDAP_DEBUG_ANY,
             "update_db_ext: instance dir is NULL\n", 0, 0, 0);
         return -1;    /* non zero */

+ 5 - 3
ldap/servers/slapd/back-ldbm/upgrade.c

@@ -58,7 +58,8 @@ db_upgrade_info ldbm_version_suss[] = {
     {BDB_IMPL, 0, 0, DBVERSION_NEW_IDL, DBVERSION_NO_UPGRADE},
     {LDBM_VERSION, 4, 2, DBVERSION_NEW_IDL, DBVERSION_NO_UPGRADE},
     {LDBM_VERSION_OLD, 4, 2, DBVERSION_OLD_IDL, DBVERSION_NO_UPGRADE}, 
-    {LDBM_VERSION_61, 3, 3, DBVERSION_NEW_IDL, DBVERSION_UPGRADE_3_4}, 
+    {LDBM_VERSION_62, 4, 2, DBVERSION_OLD_IDL, DBVERSION_NO_UPGRADE}, 
+    {LDBM_VERSION_61, 3, 3, DBVERSION_OLD_IDL, DBVERSION_UPGRADE_3_4}, 
     {LDBM_VERSION_60, 3, 3, DBVERSION_OLD_IDL, DBVERSION_UPGRADE_3_4}, 
     {NULL,0,0}
 };
@@ -274,8 +275,7 @@ adjust_idl_switch(char *ldbmversion, struct ldbminfo *li)
 
     li->li_flags |= LI_FORCE_MOD_CONFIG;
 	if ((0 == PL_strncasecmp(ldbmversion, BDB_IMPL, strlen(BDB_IMPL))) ||
-	    (0 == PL_strcmp(ldbmversion, LDBM_VERSION)) ||
-        (0 == PL_strcmp(ldbmversion, LDBM_VERSION_61)))    /* db: new idl */
+	    (0 == PL_strcmp(ldbmversion, LDBM_VERSION)))    /* db: new idl */
     {
         if (!idl_get_idl_new())   /* config: old idl */
         {
@@ -288,6 +288,8 @@ adjust_idl_switch(char *ldbmversion, struct ldbminfo *li)
         }
     }
     else if ((0 == strcmp(ldbmversion, LDBM_VERSION_OLD)) ||
+             (0 == PL_strcmp(ldbmversion, LDBM_VERSION_61)) ||
+             (0 == PL_strcmp(ldbmversion, LDBM_VERSION_62)) ||
              (0 == strcmp(ldbmversion, LDBM_VERSION_60)))    /* db: old */
     {
         if (idl_get_idl_new())   /* config: new */