Uploaded image for project: 'Directory Client API'
  1. Directory Client API
  2. DIRAPI-275

Many AttributeType are defined with the wrong m-usage

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0.0-M33
    • 1.0.0-RC1
    • None

    Description

      We have some mixture of attributeTypes defined in two ways :

      ..
      ./ldap/schema/data/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.1.16.4.ldif:m-usage: DIRECTORY_OPERATION
      ./ldap/schema/data/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.1.20.ldif:m-usage: DIRECTORY_OPERATION
      ...
      

      but

      ...
      ./ldap/schema/data/src/main/resources/schema/ou=schema/cn=pwdpolicy/ou=attributetypes/m-oid=1.3.6.1.4.1.42.2.27.8.1.16.ldif:m-usage: directoryOperation
      ./ldap/schema/data/src/main/resources/schema/ou=schema/cn=pwdpolicy/ou=attributetypes/m-oid=1.3.6.1.4.1.42.2.27.8.1.17.ldif:m-usage: directoryOperation
      ...
      

      The schema parser does not bail out because of this (ugly) method in UsageEnum class :

          /**
           * Gets the enumeration type for the attributeType usage string regardless
           * of case.
           * 
           * @param usage the usage string
           * @return the usage enumeration type
           */
          public static UsageEnum getUsage( String usage )
          {
              try
              {
                  UsageEnum result = valueOf( usage );
      
                  return result;
              }
              catch ( IllegalArgumentException iae )
              {
                  if ( "directoryOperation".equals( usage ) )
                  {
                      return DIRECTORY_OPERATION;
                  }
                  else if ( "distributedOperation".equals( usage ) )
                  {
                      return DISTRIBUTED_OPERATION;
                  }
                  else if ( "dSAOperation".equals( usage ) )
                  {
                      return DSA_OPERATION;
                  }
                  else if ( "userApplications".equals( usage ) )
                  {
                      return USER_APPLICATIONS;
                  }
                  else
                  {
                      return null;
                  }
              }
          }
      

      Not that when we have the wrong format, we fall back to a case sensitive comparison. This is very weak...

      Attachments

        Activity

          People

            Unassigned Unassigned
            elecharny Emmanuel Lécharny
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: