mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

lutoff
09.49.2008 4c56904917358fa7bac654479801984f6e4e6aa6
Back port Fix for issue #3639 (restore is not applied to the proper backend when more than one backend is defined)

Two different backends cannot be backed up in the same directory.
This modification adds the check and returns and error if we try to
backup a backend in a directory which already contains backup files from
another backend.


2 files modified
16 ■■■■■ changed files
opendj-sdk/opends/src/messages/messages/tools.properties 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tasks/BackupTask.java 12 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/messages/messages/tools.properties
@@ -2427,3 +2427,7 @@
SEVERE_ERR_CONFIGURE_LDAPUSER_NOT_EXIST_1649=User/role [%s] does not exist. \
Create it or use --userName option to specify another user
SEVERE_ERR_BACKUPDB_CANNOT_BACKUP_IN_DIRECTORY_1650=The target backend %s \
cannot be backuped is the directory %s: this directory is already a backup \
directory for backend %s
opendj-sdk/opends/src/server/org/opends/server/tasks/BackupTask.java
@@ -422,6 +422,18 @@
        {
          backupDir = BackupDirectory.readBackupDirectoryDescriptor(
               backupLocation.getPath());
          // Check the current backup directory corresponds to the provided
          // backend
          if (! backupDir.getConfigEntryDN().equals(cfg.dn()))
          {
            Message message = ERR_BACKUPDB_CANNOT_BACKUP_IN_DIRECTORY.get(
                b.getBackendID(),backupLocation.getPath(),
                backupDir.getConfigEntryDN().getRDN().
                getAttributeValue(0).getStringValue());
            logError(message);
            return false ;
          }
        }
        catch (ConfigException ce)
        {