Uploaded image for project: 'Directory ApacheDS'
  1. Directory ApacheDS
  2. DIRSERVER-578

LDAP Name Parser Trapped in Infinite Loop

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • pre-1.0
    • 1.0-RC1
    • ldap
    • None
    • Fedora Core 4

    Description

      Hi Stefan,

      Here's some JNDI JUnit Testing code that runs fine on
      0.9:

      package com.pyramidetechnologies.webapp.mdc;

      import java.util.Hashtable;

      import javax.naming.Context;
      import javax.naming.NamingException;
      import javax.naming.directory.DirContext;
      import javax.naming.directory.InitialDirContext;

      import junit.framework.TestCase;

      public class LDAPTesting extends TestCase {
      public DirContext authenticate() {
      try

      { Hashtable<String, String> env = new Hashtable<String, String>(); // Set up the environment for creating the initial context env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, "ldap://localhost:389/ou=users,ou=system"); // Authenticate as S. User and password "mysecret" env.put(Context.SECURITY_AUTHENTICATION, "simple"); env.put(Context.SECURITY_PRINCIPAL, "uid=admin,ou=system"); env.put(Context.SECURITY_CREDENTIALS, "secret"); DirContext ctx = new InitialDirContext(env); ctx.createSubcontext("mail=ole@pyramidetechnologies"); ctx.destroySubcontext("mail=ole@pyramidetechnologies"); return ctx; }

      catch (NamingException e)

      { e.printStackTrace(); return null; }

      }

      public void testAddContext() {
      DirContext ctx=authenticate();
      try

      { ctx.createSubcontext("mail=ole@pyramidetechnologies"); ctx.destroySubcontext("mail=ole@pyramidetechnologies"); }

      catch (NamingException e)

      { // TODO Auto-generated catch block e.printStackTrace(); }

      }
      }

      This code crashes the server (The only thing changed
      is this:

      ctx.createSubcontext("mail=mail=ole@pyramidetechnologies");

      Hope that helps.

      Cheers,

      • Ole

      Attachments

        Activity

          People

            elecharny Emmanuel Lécharny
            ole Ole Solberg
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: