[ 
https://issues.apache.org/jira/browse/DIRSERVER-578?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Emmanuel Lecharny closed DIRSERVER-578.
---------------------------------------


> LDAP Name Parser Trapped in Infinite Loop
> -----------------------------------------
>
>                 Key: DIRSERVER-578
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-578
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: ldap
>    Affects Versions: pre-1.0
>         Environment: Fedora Core 4
>            Reporter: Ole Ersoy
>            Assignee: Emmanuel Lecharny
>            Priority: Minor
>             Fix For: 1.0-RC1
>
>
> 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("[EMAIL PROTECTED]");
>               
> ctx.destroySubcontext("[EMAIL PROTECTED]");
>                       return ctx;
>               } catch (NamingException e) {
>                       e.printStackTrace();
>                       return null;
>               }
>       }
>       
>       public void testAddContext() {
>               DirContext ctx=authenticate();
>               try {
>               
> ctx.createSubcontext("[EMAIL PROTECTED]");
>               
> ctx.destroySubcontext("[EMAIL PROTECTED]");
>               } catch (NamingException e) {
>                       // TODO Auto-generated catch block
>                       e.printStackTrace();
>               }
>               
>       }
> }
> This code crashes the server (The only thing changed
> is this:
> ctx.createSubcontext("[EMAIL PROTECTED]");
> Hope that helps.
> Cheers,
> - Ole

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to