You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Emmanuel Lecharny (JIRA)" <ji...@apache.org> on 2019/06/27 22:00:03 UTC

[jira] [Commented] (DIRSERVER-2146) Using special chars in uid makes problem

    [ https://issues.apache.org/jira/browse/DIRSERVER-2146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16874534#comment-16874534 ] 

Emmanuel Lecharny commented on DIRSERVER-2146:
----------------------------------------------

Took some time to get this fixed !

It's related to issue [DIRAPI-349|https://issues.apache.org/jira/browse/DIRAPI-349].

The following test has been added to demonstrate that the server now handle such requests properly :

{code:java}
    @Test
    public void testAddUidWithDash() throws LdapException, IOException
    {
        connection.setTimeOut( 0L );
        connection.loadSchema();

        // Use the client API
        connection.bind( "uid=admin,ou=system", "secret" );

        // Add a new entry with some null values
        Entry entry = new DefaultEntry( getLdapServer().getDirectoryService().getSchemaManager(), 
            "uid=#4869,ou=system",
            "objectclass: top",
            "objectclass: person",
            "objectclass: inetOrgPerson",
            "uid: Hi",
            "cn: Java Duke",
            "sn: Duke", 
            "userpassword: Password1" );

        connection.add( entry );

        // Now fetch the entry
        Entry found = connection.lookup( "uid=#4869,ou=system" );

        assertNotNull( found );
        assertNotNull( found.get( "userPassword" ) );
        assertTrue( found.contains( "uid", "Hi" ) );
        
        connection.close();
    }
{code}

> Using special chars in uid makes problem
> ----------------------------------------
>
>                 Key: DIRSERVER-2146
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-2146
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 2.0.0-M21
>            Reporter: Martin Choma
>            Priority: Major
>         Attachments: LdapLoginModuleSpecialNamesTestCase.ldif
>
>
> I am trying to upgrade from version 20 to 21 and hit problem, when creating ldap items with special characters, ApacheDS fails. In version 20 the same entries were created seamlessly.
> 14:27:42,723 DEBUG [org.jboss.eapqe.krbldap.servers.ldap.LdapServer] (main) Adding entry: o=LdapLoginModuleSpecialNamesTestCasebb08edb7,o=primary,dc=jboss,dc=org
> 14:27:42,756 DEBUG [org.jboss.eapqe.krbldap.servers.ldap.LdapServer] (main) Adding entry: ou=People,o=LdapLoginModuleSpecialNamesTestCasebb08edb7,o=primary,dc=jboss,dc=org
> 14:27:42,862 DEBUG [org.jboss.eapqe.krbldap.servers.ldap.LdapServer] (main) Adding entry: ou=Roles,o=LdapLoginModuleSpecialNamesTestCasebb08edb7,o=primary,dc=jboss,dc=org
> 14:27:42,977 DEBUG [org.jboss.eapqe.krbldap.servers.ldap.LdapServer] (main) Adding entry: uid=jduke,ou=People,o=LdapLoginModuleSpecialNamesTestCasebb08edb7,o=primary,dc=jboss,dc=org
> 14:27:43,080 DEBUG [org.jboss.eapqe.krbldap.servers.ldap.LdapServer] (main) Adding entry: uid=Sue\, Grabbit and Runn,ou=People,o=LdapLoginModuleSpecialNamesTestCasebb08edb7,o=primary,dc=jboss,dc=org
> 14:27:43,162 DEBUG [org.jboss.eapqe.krbldap.servers.ldap.LdapServer] (main) Adding entry: uid=Before\0DAfter,ou=People,o=LdapLoginModuleSpecialNamesTestCasebb08edb7,o=primary,dc=jboss,dc=org
> 14:27:43,163 WARN  [org.apache.directory.server.core.normalization.NormalizationInterceptor] (pool-7-thread-1) The Rdn 'uid=Before\0DAfter' is not present in the entry
> 14:27:43,255 DEBUG [org.jboss.eapqe.krbldap.servers.ldap.LdapServer] (main) Adding entry: uid=#4869,ou=People,o=LdapLoginModuleSpecialNamesTestCasebb08edb7,o=primary,dc=jboss,dc=org
> 14:27:43,256 ERROR [org.apache.directory.api.ldap.model.entry.AbstractValue] (pool-7-thread-1) The 'uid' AttributeType and values must both be String or binary
> 14:27:43,257 WARN  [org.apache.directory.api.ldap.model.entry.DefaultEntry] (pool-7-thread-1) The Dn 'uid=#4869,ou=People,o=LdapLoginModuleSpecialNamesTestCasebb08edb7,o=primary,dc=jboss,dc=org' cannot be normalized
> 14:27:43,258 WARN  [org.apache.directory.server.core.normalization.NormalizationInterceptor] (pool-7-thread-1) The Rdn 'uid=Hi' is not present in the entry
> 14:27:43,258 WARN  [org.apache.directory.api.ldap.model.entry.DefaultAttribute] (pool-7-thread-1) ERR_04486_VALUE_ALREADY_EXISTS The value 'Hi' already exists in the attribute (uid)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org
For additional commands, e-mail: dev-help@directory.apache.org