Directory Studio
  1. Directory Studio
  2. DIRSTUDIO-861

Errors with DNs containing non-ASCII values on Active Directory

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Component/s: studio-ldapbrowser
    • Labels:
      None
    • Environment:
      Darwin 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64

      Description

      Can't get members of OU, errors occur, first occuring error stacktrace:

      Error 1
      Error while reading entry
       - 269
      java.lang.ArrayIndexOutOfBoundsException: 269
      	at org.apache.directory.shared.util.Strings.toLowerCase(Strings.java:1813)
      	at org.apache.directory.studio.ldapbrowser.core.utils.Utils.getOidString(Utils.java:132)
      	at org.apache.directory.studio.ldapbrowser.core.utils.Utils.getOidString(Utils.java:117)
      	at org.apache.directory.studio.ldapbrowser.core.utils.Utils.getNormalizedOidString(Utils.java:98)
      	at org.apache.directory.studio.ldapbrowser.core.model.impl.BrowserConnection.getEntryFromCache(BrowserConnection.java:174)
      	at org.apache.directory.studio.ldapbrowser.core.jobs.SearchRunnable.searchAndUpdateModel(SearchRunnable.java:341)
      	at org.apache.directory.studio.ldapbrowser.core.jobs.InitializeChildrenRunnable.executeSearch(InitializeChildrenRunnable.java:359)
      	at org.apache.directory.studio.ldapbrowser.core.jobs.InitializeChildrenRunnable.initializeChildren(InitializeChildrenRunnable.java:210)
      	at org.apache.directory.studio.ldapbrowser.core.jobs.InitializeChildrenRunnable.run(InitializeChildrenRunnable.java:169)
      	at org.apache.directory.studio.connection.core.jobs.StudioConnectionJob.run(StudioConnectionJob.java:109)
      	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
      
      269
      

      After first error message I get second message:

      Error 2
      Error while reading entry
      java.lang.ArrayIndexOutOfBoundsException
      
      java.lang.ArrayIndexOutOfBoundsException
      

        Issue Links

          Activity

          Hide
          Anatolij N. added a comment -

          Apache Directory Studio
          Version: 2.0.0.v20120224

          Show
          Anatolij N. added a comment - Apache Directory Studio Version: 2.0.0.v20120224
          Hide
          Pierre-Arnaud Marcelot added a comment -

          Could you please provide the LDIF corresponding to the entry you were editing?
          What directory server are you using?

          Thanks!

          Show
          Pierre-Arnaud Marcelot added a comment - Could you please provide the LDIF corresponding to the entry you were editing? What directory server are you using? Thanks!
          Hide
          Anatolij N. added a comment -

          LDIF: dn: OU=User accounts,DC=domain,DC=com
          Directory: Active Directory with Domain compatibility level Windows Server 2008 R2.

          Show
          Anatolij N. added a comment - LDIF: dn: OU=User accounts,DC= domain ,DC=com Directory: Active Directory with Domain compatibility level Windows Server 2008 R2.
          Hide
          Pierre-Arnaud Marcelot added a comment -

          This is just the DN of the entry.

          Could you please attach the full LDIF of the entry?
          (Maybe exported with another tool, if Studio is having trouble with it)

          Thanks!

          Show
          Pierre-Arnaud Marcelot added a comment - This is just the DN of the entry. Could you please attach the full LDIF of the entry? (Maybe exported with another tool, if Studio is having trouble with it) Thanks!
          Hide
          Emmanuel Lecharny added a comment -

          We really need the full entry, as it's really likely that one of ts attributeType contains a non ASCII char (we don't need the values btw, only the ATtributeTypes)

          Show
          Emmanuel Lecharny added a comment - We really need the full entry, as it's really likely that one of ts attributeType contains a non ASCII char (we don't need the values btw, only the ATtributeTypes)
          Hide
          Anatolij N. added a comment - - edited

          There are many entries in OU=User accounts,DC=domain,DC=com OU, Directory Studio can display only 2 items, 2 user accounts, all other accounts is not displayed. I can't post LDIF with personal data. Maybe I can help you with more details?

          dn: OU=User accounts,DC=domain,DC=com
          objectClass: organizationalUnit
          objectClass: top
          instanceType: 4
          objectCategory: CN=Organizational-Unit,CN=Schema,CN=Configuration,DC=domain,DC=com
          ou: User accounts
          distinguishedName: OU=User accounts,DC=domain,DC=com
          dSCorePropagationData: 16010101000001.0Z
          dSCorePropagationData: 20090414142257.0Z
          gPLink: [LDAP://CN=

          {60005EB7-108B-4C5D-9624-09DFDB122175}

          ,CN=Policies,CN=System,DC=domain,DC=com;0]
          name: User accounts
          objectGUID:: NFcnfJ4oiuyHae5555p8Hw==
          uSNChanged: 21204938
          uSNCreated: 16435
          whenChanged: 20121104153425.0Z
          whenCreated: 20090122093003.0Z

          Show
          Anatolij N. added a comment - - edited There are many entries in OU=User accounts,DC= domain ,DC=com OU, Directory Studio can display only 2 items, 2 user accounts, all other accounts is not displayed. I can't post LDIF with personal data. Maybe I can help you with more details? dn: OU=User accounts,DC= domain ,DC=com objectClass: organizationalUnit objectClass: top instanceType: 4 objectCategory: CN=Organizational-Unit,CN=Schema,CN=Configuration,DC= domain ,DC=com ou: User accounts distinguishedName: OU=User accounts,DC= domain ,DC=com dSCorePropagationData: 16010101000001.0Z dSCorePropagationData: 20090414142257.0Z gPLink: [LDAP://CN= {60005EB7-108B-4C5D-9624-09DFDB122175} ,CN=Policies,CN=System,DC= domain ,DC=com;0] name: User accounts objectGUID:: NFcnfJ4oiuyHae5555p8Hw== uSNChanged: 21204938 uSNCreated: 16435 whenChanged: 20121104153425.0Z whenCreated: 20090122093003.0Z
          Hide
          Anatolij N. added a comment -

          I have found attribute values which are encoded using base64 encoding schema. Maybe this will help you? Attribute names contain only ASCII chars.

          Show
          Anatolij N. added a comment - I have found attribute values which are encoded using base64 encoding schema. Maybe this will help you? Attribute names contain only ASCII chars.
          Hide
          Pierre-Arnaud Marcelot added a comment -

          Could we have the list of the DNs of all the entries underneath "Utils.getNormalizedOidString( new Dn("OU=User accounts,DC=domain,DC=com"), null )", please?

          We can give you a private email address if you don't want to disclose the DN on this issue.

          Thanks.

          Show
          Pierre-Arnaud Marcelot added a comment - Could we have the list of the DNs of all the entries underneath "Utils.getNormalizedOidString( new Dn("OU=User accounts,DC= domain ,DC=com"), null )", please? We can give you a private email address if you don't want to disclose the DN on this issue. Thanks.
          Hide
          Anatolij N. added a comment -

          Please explain how to list entries using 'Utils.getNormalizedOidString( new Dn("OU=User accounts,DC=domain,DC=com"), null )'? I have no developer tools for Eclipse installed.

          Show
          Anatolij N. added a comment - Please explain how to list entries using 'Utils.getNormalizedOidString( new Dn("OU=User accounts,DC= domain ,DC=com"), null )'? I have no developer tools for Eclipse installed.
          Hide
          Pierre-Arnaud Marcelot added a comment -

          Sorry, it was a wrong copy/paste. I meant "[...] underneath 'OU=User accounts,DC=domain,DC=com' [...]".

          You can use another LDAP Browser tool to do this (Softerra, JXplorer, LDAPExplorerTool, etc.), as Apache Directory Studio seems to have some trouble with one of the entries underneath 'OU=User accounts,DC=domain,DC=com'.

          Thanks.

          Show
          Pierre-Arnaud Marcelot added a comment - Sorry, it was a wrong copy/paste. I meant " [...] underneath 'OU=User accounts,DC= domain ,DC=com' [...] ". You can use another LDAP Browser tool to do this (Softerra, JXplorer, LDAPExplorerTool, etc.), as Apache Directory Studio seems to have some trouble with one of the entries underneath 'OU=User accounts,DC= domain ,DC=com'. Thanks.
          Hide
          Anatolij N. added a comment -

          I'm very sorry, but information you request could not be shared due to corporate security policy.

          Show
          Anatolij N. added a comment - I'm very sorry, but information you request could not be shared due to corporate security policy.
          Hide
          Pierre-Arnaud Marcelot added a comment -

          I understand, that's why I offered you the private email option, rather than posting it online in this JIRA issue.
          Now, I'd also understand if that second option is not possible as well.

          But in that case, we won't be able to fix the issue.

          The stacktrace clearly indicates that a one of the DNs underneath "OU=User accounts,DC=domain,DC=com" is giving Studio a hard time. Probably because the DN contains a non-ASCII character (or something like that).
          Without the appropriate DN we can't investigate any further.

          Show
          Pierre-Arnaud Marcelot added a comment - I understand, that's why I offered you the private email option, rather than posting it online in this JIRA issue. Now, I'd also understand if that second option is not possible as well. But in that case, we won't be able to fix the issue. The stacktrace clearly indicates that a one of the DNs underneath "OU=User accounts,DC= domain ,DC=com" is giving Studio a hard time. Probably because the DN contains a non-ASCII character (or something like that). Without the appropriate DN we can't investigate any further.
          Hide
          Grzegorz Grzybek added a comment -

          I had some time to check this bug which annoyed me since migration from 1.x to 2.x version of this plugin. The problem is resolved for me (I'm using my own version of org.apache.directory.studio.ldapbrowser.core_2.0.0.v20130131.jar) by the following diff:

          $ git diff plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
          diff --git a/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java b/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
          index cd33c38..fb18393 100644
          --- a/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
          +++ b/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
          @@ -130,7 +130,7 @@ public class Utils
                   String oid = schema != null ? schema.getAttributeTypeDescription( ava.getNormType() ).getOid() : ava
                       .getNormType();
                   return Strings.toLowerCase( Strings.trim( oid ) )
          -            + "=" + Strings.toLowerCase( Strings.trim( ava.getValue().getString() ) ); //$NON-NLS-1$
          +            + "=" + Strings.trim( ava.getValue().getString() ).toLowerCase(); //$NON-NLS-1$
               }
          
          
          

          Please see pull request: https://github.com/apache/directory-studio/pull/1.

          regards
          Grzegorz Grzybek

          Show
          Grzegorz Grzybek added a comment - I had some time to check this bug which annoyed me since migration from 1.x to 2.x version of this plugin. The problem is resolved for me (I'm using my own version of org.apache.directory.studio.ldapbrowser.core_2.0.0.v20130131.jar ) by the following diff : $ git diff plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java diff --git a/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java b/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java index cd33c38..fb18393 100644 --- a/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java +++ b/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java @@ -130,7 +130,7 @@ public class Utils String oid = schema != null ? schema.getAttributeTypeDescription( ava.getNormType() ).getOid() : ava .getNormType(); return Strings.toLowerCase( Strings.trim( oid ) ) - + "=" + Strings.toLowerCase( Strings.trim( ava.getValue().getString() ) ); //$NON-NLS-1$ + + "=" + Strings.trim( ava.getValue().getString() ).toLowerCase(); //$NON-NLS-1$ } Please see pull request: https://github.com/apache/directory-studio/pull/1 . regards Grzegorz Grzybek
          Hide
          Grzegorz Grzybek added a comment -

          Please enable JIRA wiki formatter for comments please

          Show
          Grzegorz Grzybek added a comment - Please enable JIRA wiki formatter for comments please
          Hide
          Pierre-Arnaud Marcelot added a comment -

          Great catch!
          Seems like we were trying to normalize the value of AVA with a too restrictive toLowerCase() method since the value can contain non-ascii characters.

          I can't apply the pull request on github, but I'm going to use to diff you provided.

          Thanks for the patch.

          Show
          Pierre-Arnaud Marcelot added a comment - Great catch! Seems like we were trying to normalize the value of AVA with a too restrictive toLowerCase() method since the value can contain non-ascii characters. I can't apply the pull request on github, but I'm going to use to diff you provided. Thanks for the patch.
          Hide
          Pierre-Arnaud Marcelot added a comment -
          Show
          Pierre-Arnaud Marcelot added a comment - Fixed at revision 1445554. http://svn.apache.org/viewvc?view=revision&revision=r1445554

            People

            • Assignee:
              Pierre-Arnaud Marcelot
              Reporter:
              Anatolij N.
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development