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

gbellato
03.35.2008 dd9090e630e82d58abdc1bfea933bbe02a3a2485
opends/src/server/org/opends/server/replication/protocol/ModifyDNMsg.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Portions Copyright 2006-2007 Sun Microsystems, Inc.
 *      Portions Copyright 2006-2008 Sun Microsystems, Inc.
 */
package org.opends.server.replication.protocol;
@@ -38,6 +38,7 @@
import org.opends.server.types.AbstractOperation;
import org.opends.server.types.DN;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.RDN;
import org.opends.server.types.operation.PostOperationModifyDNOperation;
/**
@@ -279,8 +280,18 @@
  {
    try
    {
      String newStringDN = newRDN + "," + newSuperior;
      DN newDN = DN.decode(newStringDN);
      DN newDN;
      if (newSuperior == null)
      {
        DN parentDn = DN.decode(this.getDn()).getParent();
        newDN = parentDn.concat(RDN.decode(newRDN));
      }
      else
      {
        String newStringDN = newRDN + "," + newSuperior;
        newDN = DN.decode(newStringDN);
      }
      if (newDN.isAncestorOf(targetDn))
        return true;