Hiroyuki Wada created DIRAPI-395:
------------------------------------

             Summary: Improve unescaped backslash handling in DESC for IBM's 
directory servers
                 Key: DIRAPI-395
                 URL: https://issues.apache.org/jira/browse/DIRAPI-395
             Project: Directory Client API
          Issue Type: Improvement
            Reporter: Hiroyuki Wada


IBM Security Verify Directory (formerly known as IBM Security Directory Server, 
and previously as IBM Tivoli Directory Server) uses Non-comliant LDAP schema 
definitions. Specifically, there are cases where DESC contains unescaped 
backslashes, like the following example.

{noformat}
attributeTypes: ( 1.3.18.0.2.4.575 NAME 'role' DESC 'Based on CIM.  A free form 
string describing the role of the Processor - for example, \Central Processor\ 
or \Math Processor\.' EQUALITY 2.5.13.2 SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 
SINGLE-VALUE )
{noformat}

Unfortunately, in the current implementation, the position of backslash can 
lead to error. For example, parsing the above schema using the 
AttributeTypeDescriptionSchemaParser results in a 
java.lang.ArrayIndexOutOfBoundsException.

{noformat}
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 118 out of bounds 
for length 118
      at 
org.apache.directory.api.ldap.model.schema.parsers.OpenLdapSchemaParser.getQDString(OpenLdapSchemaParser.java:1835)
      at 
org.apache.directory.api.ldap.model.schema.parsers.OpenLdapSchemaParser.parseAttributeTypeRelaxed(OpenLdapSchemaParser.java:3167)
      at 
org.apache.directory.api.ldap.model.schema.parsers.OpenLdapSchemaParser.parseAttributeType(OpenLdapSchemaParser.java:2811)
      at 
org.apache.directory.api.ldap.model.schema.parsers.AttributeTypeDescriptionSchemaParser.parse(AttributeTypeDescriptionSchemaParser.java:81)
      at 
org.apache.directory.ldap.client.api.DefaultSchemaLoader.loadAttributeTypes(DefaultSchemaLoader.java:358)
      at 
org.apache.directory.ldap.client.api.DefaultSchemaLoader.loadSchemas(DefaultSchemaLoader.java:301)
      at 
org.apache.directory.ldap.client.api.DefaultSchemaLoader.<init>(DefaultSchemaLoader.java:188)
{noformat}

To address this issue, I've wrote a patch that allows unescaped backslash in 
DESC during parsing when quirks mode is enabled. I have pushed the 
implementation to the following GitHub URL:

https://github.com/openstandia/directory-ldap-api/commits/improve-desc-escape 

If this improvement is welcome, I would like to submit a pull request.




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to