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

Version M19 does not allow eszet (ß) in any tested field of inetOrgPerson

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M19
    • Fix Version/s: 2.0.0-M20
    • Component/s: ldap
    • Labels:
      None
    • Environment:
      Windows

      Description

      Type: inetOrgPerson
      Character to add ß - 0x00DF in e.g. givenName or postalAddress ApacheDS returns an error.
      Tested systems: Directory Studio and PHP
      Error returned from: M19
      No error in: M15

      PHP error:
      Other (e.g., implementation specific) error (Error 80)

      Log from Directory Studio:
      #!ERROR [LDAP: error code 80 - OTHER: failed for MessageType : MODIFY_REQUEST Message ID : 14 Modify Request Object : 'uid=123456,dc=example,dc=com' Modification[0] Operation : replace Modification givenName: test ß testorg.apache.directory.api.ldap.model.message.ModifyRequestImpl@b71686f1: 35: java.lang.ArrayIndexOutOfBoundsException: 35 at org.apache.directory.api.ldap.model.schema.PrepareString.map(PrepareString.java:4061) at org.apache.directory.api.ldap.model.schema.PrepareString.insignifiantSpacesString(PrepareString.java:4839) at org.apache.directory.api.ldap.model.schema.PrepareString.normalize(PrepareString.java:257) at org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimToLowerNormalizer.normalize(DeepTrimToLowerNormalizer.java:103) at org.apache.directory.api.ldap.model.schema.normalizers.CachingNormalizer.normalize(CachingNormalizer.java:124) at org.apache.directory.api.ldap.model.entry.AbstractValue.apply(AbstractValue.java:164) at org.apache.directory.api.ldap.model.entry.StringValue.<init>(StringValue.java:108) at org.apache.directory.api.ldap.model.entry.DefaultAttribute.<init>(DefaultAttribute.java:478) at org.apache.directory.server.core.api.entry.ServerEntryUtils.toServerModification(ServerEntryUtils.java:448) at org.apache.directory.server.core.api.entry.ServerEntryUtils.toServerModification(ServerEntryUtils.java:488) at org.apache.directory.server.core.api.interceptor.context.ModifyOperationContext.<init>(ModifyOperationContext.java:105) at org.apache.directory.server.core.shared.DefaultCoreSession.modify(DefaultCoreSession.java:971) at org.apache.directory.server.core.shared.DefaultCoreSession.modify(DefaultCoreSession.java:962) at org.apache.directory.server.ldap.handlers.request.ModifyRequestHandler.handle(ModifyRequestHandler.java:56) at org.apache.directory.server.ldap.handlers.request.ModifyRequestHandler.handle(ModifyRequestHandler.java:39) at org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:207) at org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:56) at org.apache.mina.handler.demux.DemuxingIoHandler.messageReceived(DemuxingIoHandler.java:221) at org.apache.directory.server.ldap.LdapProtocolHandler.messageReceived(LdapProtocolHandler.java:217) at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:854) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:542) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:48) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:943) at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:74) at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63) at org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.runTask(UnorderedThreadPoolExecutor.java:475) at org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.run(UnorderedThreadPoolExecutor.java:429) at java.lang.Thread.run(Unknown Source) ]
      dn: uid=123456,dc=example,dc=com
      changetype: modify
      replace: givenName
      givenName:: dGVzdCDDnyB0ZXN0

        Activity

        Hide
        elecharny Emmanuel Lecharny added a comment -

        I confirm there is a pb. I can reproduce the issue.

        Show
        elecharny Emmanuel Lecharny added a comment - I confirm there is a pb. I can reproduce the issue.
        Hide
        elecharny Emmanuel Lecharny added a comment -

        Ok, clear bug. We do a System.arrayCopy() on the String, regardless of the fact that it contains UTF-8 chars. Typically, that transforms the 'ß' into 'ss', so there is one more char, which leads to an OutOfBoundsException...

        Good catch !

        Show
        elecharny Emmanuel Lecharny added a comment - Ok, clear bug. We do a System.arrayCopy() on the String, regardless of the fact that it contains UTF-8 chars. Typically, that transforms the 'ß' into 'ss', so there is one more char, which leads to an OutOfBoundsException... Good catch !
        Hide
        elecharny Emmanuel Lecharny added a comment -

        Bad analysis. The System.arrayCopy() is not the cause of the pb. The real pb is that we do a substitution of 'ß' into 'ss' in the ReplaceString().map() method, as requested by https://www.ietf.org/rfc/rfc3454.txt. Sadly, we do that on the array itself, looping on each of its content. When we replace the 'ß', we move forward 2 chars instead of one ('ss') and then we go one char too long (and we obviously lose one char from the original string too).

        This is really a nasty bug...

        Show
        elecharny Emmanuel Lecharny added a comment - Bad analysis. The System.arrayCopy() is not the cause of the pb. The real pb is that we do a substitution of 'ß' into 'ss' in the ReplaceString().map() method, as requested by https://www.ietf.org/rfc/rfc3454.txt . Sadly, we do that on the array itself, looping on each of its content. When we replace the 'ß', we move forward 2 chars instead of one ('ss') and then we go one char too long (and we obviously lose one char from the original string too). This is really a nasty bug...
        Hide
        elecharny Emmanuel Lecharny added a comment -
        Show
        elecharny Emmanuel Lecharny added a comment - Fixed with : http://svn.apache.org/r1641446 Tested with : http://svn.apache.org/r1641445

          People

          • Assignee:
            Unassigned
            Reporter:
            cqix_ustrich Christian Koller
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development