You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Endi S. Dewata (JIRA)" <di...@incubator.apache.org> on 2005/02/15 22:00:44 UTC

[jira] Created: (DIREVE-137) Problems with mixed-case in suffix

Problems with mixed-case in suffix
----------------------------------

         Key: DIREVE-137
         URL: http://issues.apache.org/jira/browse/DIREVE-137
     Project: Directory Server
        Type: Bug
  Components: jdbm database, jndi-provider, server main  
    Versions: 0.8    
    Reporter: Endi S. Dewata
 Assigned to: Alex Karasulu 
    Priority: Minor


The server currently has some problems with suffixes that contain mixed cases, e.g. dc=VergeNet, dc=com.

1. Add
------

In ServerContextFactory.java line #630, JdbmDatabase is initialized with un-normalized suffix.

    Database db = new JdbmDatabase( upSuffix, wkdir );

But in JdbmDatabase.java line #673, when adding an entry to the database, the suffix is compared with the normalized dn of the new entry.

    if ( dn.equals( suffix ) )

This is causing the add operation to fail.


2. Search
---------

In RootNexus.java line #203, the suffix is being normalized during registration.

    backends.put( backend.getSuffix( true ).toString(), backend );

However, in RootNexus.java line #556, the dn used to look up the backend is not normalized.

    return ( ContextPartition ) backends.get( clonedDn.toString() );

This is causing the search operation to fail.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DIREVE-137) Problems with mixed-case in suffix

Posted by "Alex Karasulu (JIRA)" <di...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/DIREVE-137?page=history ]

Alex Karasulu updated DIREVE-137:
---------------------------------

    Fix Version: 0.9

> Problems with mixed-case in suffix
> ----------------------------------
>
>          Key: DIREVE-137
>          URL: http://issues.apache.org/jira/browse/DIREVE-137
>      Project: Directory Server
>         Type: Bug
>   Components: jndi-provider, jdbm database, server main
>     Versions: 0.8
>     Reporter: Endi S. Dewata
>     Assignee: Alex Karasulu
>     Priority: Minor
>      Fix For: 0.9
>  Attachments: mixed-case.patch
>
> The server currently has some problems with suffixes that contain mixed cases, e.g. dc=VergeNet, dc=com.
> 1. Add
> ------
> In ServerContextFactory.java line #630, JdbmDatabase is initialized with un-normalized suffix.
>     Database db = new JdbmDatabase( upSuffix, wkdir );
> But in JdbmDatabase.java line #673, when adding an entry to the database, the suffix is compared with the normalized dn of the new entry.
>     if ( dn.equals( suffix ) )
> This is causing the add operation to fail.
> 2. Search
> ---------
> In RootNexus.java line #203, the suffix is being normalized during registration.
>     backends.put( backend.getSuffix( true ).toString(), backend );
> However, in RootNexus.java line #556, the dn used to look up the backend is not normalized.
>     return ( ContextPartition ) backends.get( clonedDn.toString() );
> This is causing the search operation to fail.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIREVE-137) Problems with mixed-case in suffix

Posted by "Alex Karasulu (JIRA)" <di...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/DIREVE-137?page=comments#action_60048 ]
     
Alex Karasulu commented on DIREVE-137:
--------------------------------------

Good catch - I've been working on trying to figure out how we can fix this for good.  Looks like we're really exposed in several ways.  I was going to fix this with a Normalization interceptor service but I backed out for some reason.  I'll take another look at doing this later ....

For the time being I fixed the first point you have made about the normalizated mismatch by adding the normalized name to the JdbmDatabase constructor.



 

> Problems with mixed-case in suffix
> ----------------------------------
>
>          Key: DIREVE-137
>          URL: http://issues.apache.org/jira/browse/DIREVE-137
>      Project: Directory Server
>         Type: Bug
>   Components: jdbm database, jndi-provider, server main
>     Versions: 0.8
>     Reporter: Endi S. Dewata
>     Assignee: Alex Karasulu
>     Priority: Minor
>  Attachments: mixed-case.patch
>
> The server currently has some problems with suffixes that contain mixed cases, e.g. dc=VergeNet, dc=com.
> 1. Add
> ------
> In ServerContextFactory.java line #630, JdbmDatabase is initialized with un-normalized suffix.
>     Database db = new JdbmDatabase( upSuffix, wkdir );
> But in JdbmDatabase.java line #673, when adding an entry to the database, the suffix is compared with the normalized dn of the new entry.
>     if ( dn.equals( suffix ) )
> This is causing the add operation to fail.
> 2. Search
> ---------
> In RootNexus.java line #203, the suffix is being normalized during registration.
>     backends.put( backend.getSuffix( true ).toString(), backend );
> However, in RootNexus.java line #556, the dn used to look up the backend is not normalized.
>     return ( ContextPartition ) backends.get( clonedDn.toString() );
> This is causing the search operation to fail.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIREVE-137) Problems with mixed-case in suffix

Posted by "Endi S. Dewata (JIRA)" <di...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/DIREVE-137?page=comments#action_59220 ]
     
Endi S. Dewata commented on DIREVE-137:
---------------------------------------

Here's a suggested addition to ServerContextFactoryTest.java.

public ServerContextFactoryTest()
{
   ...

   extras.put( EnvKeys.PARTITIONS, "testing example mixedCase" );

   ...

   attrs = new BasicAttributes( true );
   attr = new BasicAttribute( "objectClass" );
   attr.add( "top" );
   attr.add( "domain" );
   attr.add( "extensibleObject" );
   attrs.put( attr );
   attr = new BasicAttribute( "dc" );
   attr.add( "mixedCase" );
   attrs.put( attr );

   extras.put( EnvKeys.SUFFIX + "mixedCase", "dc=mixedCase" );
   extras.put( EnvKeys.INDICES + "mixedCase", "ou dc objectClass" );
   extras.put( EnvKeys.ATTRIBUTES + "mixedCase", attrs );
}

public void testAppPartitionMixedCase() throws NamingException
{
   Hashtable env = new Hashtable();
   env.put( Context.PROVIDER_URL, "ou=mixedCase" );
   env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
   env.put( Context.SECURITY_CREDENTIALS, "secret" );
   env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.ldap.server.jndi.ServerContextFactory" );
   InitialContext initialContext = new InitialContext( env );
   DirContext appRoot = ( DirContext ) initialContext.lookup( "" );
   assertNotNull( appRoot );

   Attributes attributes = appRoot.getAttributes( "" );
   assertNotNull( attributes );
   assertEquals( "mixedCase", attributes.get( "dc" ).get() );
   Attribute attribute = attributes.get( "objectClass" );
   assertNotNull( attribute );
   assertTrue( attribute.contains( "top" ) );
   assertTrue( attribute.contains( "domain" ) );
}


> Problems with mixed-case in suffix
> ----------------------------------
>
>          Key: DIREVE-137
>          URL: http://issues.apache.org/jira/browse/DIREVE-137
>      Project: Directory Server
>         Type: Bug
>   Components: jdbm database, jndi-provider, server main
>     Versions: 0.8
>     Reporter: Endi S. Dewata
>     Assignee: Alex Karasulu
>     Priority: Minor

>
> The server currently has some problems with suffixes that contain mixed cases, e.g. dc=VergeNet, dc=com.
> 1. Add
> ------
> In ServerContextFactory.java line #630, JdbmDatabase is initialized with un-normalized suffix.
>     Database db = new JdbmDatabase( upSuffix, wkdir );
> But in JdbmDatabase.java line #673, when adding an entry to the database, the suffix is compared with the normalized dn of the new entry.
>     if ( dn.equals( suffix ) )
> This is causing the add operation to fail.
> 2. Search
> ---------
> In RootNexus.java line #203, the suffix is being normalized during registration.
>     backends.put( backend.getSuffix( true ).toString(), backend );
> However, in RootNexus.java line #556, the dn used to look up the backend is not normalized.
>     return ( ContextPartition ) backends.get( clonedDn.toString() );
> This is causing the search operation to fail.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DIREVE-137) Problems with mixed-case in suffix

Posted by "Endi S. Dewata (JIRA)" <di...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/DIREVE-137?page=history ]

Endi S. Dewata updated DIREVE-137:
----------------------------------

    Attachment: mixed-case.patch

Here's a patch containing the test case for this bug.

> Problems with mixed-case in suffix
> ----------------------------------
>
>          Key: DIREVE-137
>          URL: http://issues.apache.org/jira/browse/DIREVE-137
>      Project: Directory Server
>         Type: Bug
>   Components: jndi-provider, jdbm database, server main
>     Versions: 0.8
>     Reporter: Endi S. Dewata
>     Assignee: Alex Karasulu
>     Priority: Minor
>  Attachments: mixed-case.patch
>
> The server currently has some problems with suffixes that contain mixed cases, e.g. dc=VergeNet, dc=com.
> 1. Add
> ------
> In ServerContextFactory.java line #630, JdbmDatabase is initialized with un-normalized suffix.
>     Database db = new JdbmDatabase( upSuffix, wkdir );
> But in JdbmDatabase.java line #673, when adding an entry to the database, the suffix is compared with the normalized dn of the new entry.
>     if ( dn.equals( suffix ) )
> This is causing the add operation to fail.
> 2. Search
> ---------
> In RootNexus.java line #203, the suffix is being normalized during registration.
>     backends.put( backend.getSuffix( true ).toString(), backend );
> However, in RootNexus.java line #556, the dn used to look up the backend is not normalized.
>     return ( ContextPartition ) backends.get( clonedDn.toString() );
> This is causing the search operation to fail.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIREVE-137) Problems with mixed-case in suffix

Posted by "Endi S. Dewata (JIRA)" <di...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/DIREVE-137?page=comments#action_59785 ]
     
Endi S. Dewata commented on DIREVE-137:
---------------------------------------

Forgot to add, the patch was made against ApacheDS 0.9.

> Problems with mixed-case in suffix
> ----------------------------------
>
>          Key: DIREVE-137
>          URL: http://issues.apache.org/jira/browse/DIREVE-137
>      Project: Directory Server
>         Type: Bug
>   Components: jndi-provider, jdbm database, server main
>     Versions: 0.8
>     Reporter: Endi S. Dewata
>     Assignee: Alex Karasulu
>     Priority: Minor
>  Attachments: mixed-case.patch
>
> The server currently has some problems with suffixes that contain mixed cases, e.g. dc=VergeNet, dc=com.
> 1. Add
> ------
> In ServerContextFactory.java line #630, JdbmDatabase is initialized with un-normalized suffix.
>     Database db = new JdbmDatabase( upSuffix, wkdir );
> But in JdbmDatabase.java line #673, when adding an entry to the database, the suffix is compared with the normalized dn of the new entry.
>     if ( dn.equals( suffix ) )
> This is causing the add operation to fail.
> 2. Search
> ---------
> In RootNexus.java line #203, the suffix is being normalized during registration.
>     backends.put( backend.getSuffix( true ).toString(), backend );
> However, in RootNexus.java line #556, the dn used to look up the backend is not normalized.
>     return ( ContextPartition ) backends.get( clonedDn.toString() );
> This is causing the search operation to fail.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira