directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (DIRSERVER-1442) Using escaped plus character in RDN leads to double attribute entry.
Date Tue, 15 Dec 2009 17:08:18 GMT

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

Emmanuel Lecharny resolved DIRSERVER-1442.
------------------------------------------

    Resolution: Fixed

Seems to be fixed in trunk. We have added this test, which works weel (we get only one CN
value) :

    public void testAddAttributeWithEscapedPlusCharacter() throws Exception
    {
        Attributes attributes = new BasicAttributes( false );
        attributes.put( "objectClass", "top" );
        attributes.put( "objectClass", "inetorgperson" );
        attributes.put( "cn", "John\\+Doe" );
        attributes.put( "sn", "\\+Name\\+" );
        
        LdapContext sysRoot = getSystemContext( service );
        DirContext dc = sysRoot.createSubcontext( "cn=John\\+Doe", attributes );
        
        ServerLdapContext sc = ( ServerLdapContext ) dc;
        
        assertTrue( sc.getDn().toString().contains( "+" ) );

        try
        {
           Object obj = sysRoot.lookup( "cn=John\\+Doe" );
           assertNotNull( obj );
        }
        catch( Exception e )
        {
            fail( e.getMessage() );
        }
        
        try
        {
           Attributes result = sysRoot.getAttributes( "cn=John\\+Doe" );
           assertNotNull( result );
           
           Attribute cn = result.get( "cn" );
           assertNotNull( cn );
           assertEquals( 1, cn.size() );
        }
        catch( Exception e )
        {
            fail( e.getMessage() );
        }
    }


> Using escaped plus character in RDN leads to double attribute entry.
> --------------------------------------------------------------------
>
>                 Key: DIRSERVER-1442
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1442
>             Project: Directory ApacheDS
>          Issue Type: Sub-task
>          Components: core
>    Affects Versions: 1.5.5
>         Environment: WinXPx64, JDK 1_5_0_22, Tomcat 5.0.19, ADS 1.5.5, ADStudio 1.5.0.v20091102
> A partition of type:
> objectClass=dcObject
> objectClass=organization
> objectClass=top
> dc=example
> o=org 
>            Reporter: G√ľnter Albrecht
>            Assignee: Emmanuel Lecharny
>            Priority: Critical
>             Fix For: 2.0.0-RC1
>
>
> 3. scenario - escaped plus character somewhere in the RDN attribute:
>   public void insert() {
>     Attributes attributes = new BasicAttributes(false);
>     attributes.put(createObjectClassPerson());
>     attributes.put("cn", "John\\+Doe");
>     attributes.put("sn", "\\+Name\\+");
>     try {
>       getLdapContext().createSubcontext("cn=John\\+Doe", attributes);
>     }
>     catch (NamingException e) {
>       e.printStackTrace();
>     }
>   }
> The result is an entry with two cn attributes, one with a plus and the other one with
an escaped plus. Also a warning appears
> WARN [org.apache.directory.server.core.normalization.NormalizationInterceptor] - The
RDN 'cn=John\+Doe' is not present in the entry.

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


Mime
View raw message