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

Jean-Noël Rouvignac
29.15.2016 08154804f671e1c471df14ac999e6d6bb18bbd37
opendj-server-legacy/src/main/java/org/opends/admin/ads/util/ServerLoader.java
@@ -24,10 +24,10 @@
import javax.naming.NamingException;
import javax.naming.NoPermissionException;
import javax.naming.TimeLimitExceededException;
import javax.naming.ldap.LdapName;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import org.forgerock.opendj.ldap.DN;
import org.opends.admin.ads.ADSContext;
import org.opends.admin.ads.ADSContext.ServerProperty;
import org.opends.admin.ads.ServerDescriptor;
@@ -53,7 +53,7 @@
  private ServerDescriptor serverDescriptor;
  private final ApplicationTrustManager trustManager;
  private final int timeout;
  private final String dn;
  private final DN dn;
  private final String pwd;
  private final LinkedHashSet<PreferredConnection> preferredLDAPURLs;
  private final TopologyCacheFilter filter;
@@ -77,8 +77,7 @@
   * to retrieve all the information.
   */
  public ServerLoader(Map<ServerProperty,Object> serverProperties,
      String dn, String pwd, ApplicationTrustManager trustManager,
      int timeout,
      DN dn, String pwd, ApplicationTrustManager trustManager, int timeout,
      Set<PreferredConnection> preferredLDAPURLs,
      TopologyCacheFilter filter)
  {
@@ -215,7 +214,8 @@
    for (PreferredConnection connection : getLDAPURLsByPreference())
    {
      lastLdapUrl = connection.getLDAPURL();
      ConnectionWrapper conn = new ConnectionWrapper(lastLdapUrl, connection.getType(), dn, pwd, timeout, trustManager);
      ConnectionWrapper conn =
          new ConnectionWrapper(lastLdapUrl, connection.getType(), dn.toString(), pwd, timeout, trustManager);
      if (conn.getLdapContext() != null)
      {
        return conn;
@@ -345,10 +345,8 @@
  {
    try
    {
      LdapName theDn = new LdapName(dn);
      LdapName containerDn =
        new LdapName(ADSContext.getAdministratorContainerDN());
      return theDn.startsWith(containerDn);
      DN containerDn = DN.valueOf(ADSContext.getAdministratorContainerDN());
      return dn.isSubordinateOrEqualTo(containerDn);
    }
    catch (Throwable t)
    {