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

Matthew Swift
15.21.2012 531193421e4b73dc1a922f30c46d74ea29996d56
Final fix for OPENDJ-249: dsreplication disable --disableAll error removing contents of "cn=admin data"

Don't remove instance keys when disabling replication. Instance keys are intended for other purposes as well as replication, for example log signing, etc, and may be required after an instance has been removed from a topology. It is the responsibility of administrators to manually remove unused instance keys on a case by case basis.
2 files modified
24 ■■■■■ changed files
opendj-sdk/opends/src/ads/org/opends/admin/ads/ADSContext.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliMain.java 16 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/ads/org/opends/admin/ads/ADSContext.java
@@ -563,12 +563,6 @@
    LdapName dn = makeDNFromServerProperties(serverProperties);
    try
    {
      if (serverProperties.containsKey(
          ServerProperty.INSTANCE_PUBLIC_KEY_CERTIFICATE))
      {
        unregisterInstanceKeyCertificate(serverProperties, dn);
      }
      // Unregister the server from the server groups.
      String member = "cn="
        + Rdn.escapeValue(serverProperties.get(ServerProperty.ID));
@@ -1251,7 +1245,6 @@
  {
    String[] dns = {getServerContainerDN(),
        getServerGroupContainerDN(),
        getInstanceKeysContainerDN(),
        removeAdministrators ? getAdministratorContainerDN() : null };
    try
    {
@@ -2511,6 +2504,7 @@
  @param serverEntryDn The server's ADS entry DN.
  @throws NamingException In case some JNDI operation fails.
   */
  @SuppressWarnings("unused")
  private void unregisterInstanceKeyCertificate(
      Map<ServerProperty, Object> serverProperties,
      LdapName serverEntryDn)
opendj-sdk/opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliMain.java
@@ -7017,22 +7017,6 @@
            ERR_REPLICATION_UPDATING_ADS.get(adce.getMessageObject()),
            ERROR_UPDATING_ADS, adce);
      }
      try
      {
        // Delete all contents from truststore.
        printProgress(formatter.getFormattedWithPoints(
            INFO_REPLICATION_REMOVE_TRUSTSTORE_CONTENTS.get()));
        ServerDescriptor.cleanAdsTrustStore(adsCtx.getDirContext());
        printProgress(formatter.getFormattedDone());
        printlnProgress();
      }
      catch (Throwable t)
      {
        LOG.log(Level.SEVERE, "Error removing contents of truststore: "+t, t);
        throw new ReplicationCliException(
            ERR_REPLICATION_UPDATING_ADS.get(t.toString()),
            ERROR_UPDATING_ADS, t);
      }
    }
    else if (disableAllBaseDns &&
        (disableReplicationServer || !server.isReplicationServer()))