Skip to main content

 
IBM Power Systems software  >  IBM i  > Software  > 

Matching Rules for String Attributes

  

If an attribute is defined with one of the two string syntaxes, Directory String or IA5 String, the server will now honor the matching behavior specified in the schema for the attribute, correcting an error in previous releases. You can define an attribute to be case sensitive or to ignore case when matching. Previously the server allowed a matching rule to be defined, but ignored it. Internally the server treated IA5 String as case sensitive, and Directory String as case insensitive. If your server had defined attributes as IA5 String with caseIgnoreMatch, or DirectoryString with caseExactMatch, the server will now behave correctly for those attributes.

Note that the server does not distinguish between Directory String and IA5 String. Directory String allows all UTF-8 strings, while some servers may restrict attributes using IA5 String to the IA5 character set (7-bit US ASCII).

And note that the use of the term "string syntax" here refers to the content of the value. In general, all LDAP syntaxes are represented as strings. Boolean attributes, for example have the values "TRUE" or "FALSE", while the integer value 1 is represented as the string "1".

Matching rules affect the following server operations:

  • Search and compare: The matching rule determines how the server compares a value in a search filter (cn=john smith) or compare operation to the attribute values in the directory. For example, (cn=John Smith) will match "john smith" because cn is defined to ignore case.
  • Duplicate values: The matching rule determines if case is used when determining if a value is a duplicate of an existing attribute value. Recall that directory entries are not allowed to contain duplicate values. For example, a single entry is not allowed to contain the cn values "John Smith" and "john smith" because the cn attribute is defined to ignore case.
  • Deleting values: The matching rule determines which value, if any, is to be deleted by a LDAP modify request to delete a value. For example, a request to delete the cn attribute with the value "john smith" will delete the value "John Smith".

The following matching rules are treated as "ignore case":

     caseIgnoreIA5Match - 1.3.6.1.4.1.1466.109.114.2
     caseIgnoreMatch - 2.5.13.2
     caseIgnoreOrderingMatch - 2.5.13.3
     caseIgnoreSubstringMatch - 2.5.13.4

The following matching rules are treated as "case exact":

     caseExactIA5Match - 1.3.6.1.4.1.1466.109.114.2
     caseExactMatch - 2.5.13.5
     caseExactOrderingMatch - 2.5.13.6
     caseExactSubstringMatch - 2.5.13.7

For non-string attributes, the matching rule that corresponds to the syntax must be used:

  • distinguished name - distinguishedNameMatch
  • integer - integerMatch (integer ordering is implied)
  • boolean - none (boolean matching is implied)
  • telephone number - telephoneNumberMatch, telephoneSubstringMatch
  • generalized time - generalizedTimeMatch, generalizedTimeOrderingMatch
  • binary - octetStringMatch (though the server does not support searching for entries matching a particular binary value)

When you define matching rules for an attribute, the equality, ordering, and substring rules must all be equivalent. You cannot mix case ignore and case exact rules in a single attribute definition. Also, for our server, it is necessary only to define the equality matching rule. The other matching rules can be defined for completeness. If your are defining a schema that will be used on other servers, it is possible that the omission of a matching rule might result, for example, in the server not allowing a search like (myattr>=abc). If no matching rule is defined, the default behavior is that string attributes are treated as case ignore.

An example of an attribute which ignores case (2.5.13.2 is the object identifier for caseIgnorematch):

   attributetypes=( 2.5.4.3 NAME ( 'cn' 'commonName' ) 
   DESC 'This is the X.500 commonName attribute, which 
   contains a name of an object. If the object corresponds 
   to a person, it is typically the persons full name.' SUP 
   2.5.4.41 EQUALITY 2.5.13.2 ORDERING 2.5.13.3 SUBSTR 
   2.5.13.4 )

The following values are treated as the same when matching values:

   cn: John Smith
   cn: john smith
   cn: JOHN SMITH

An example of an attribute which is case exact (2.5.13.5 is the object identifier for caseExactMatch):

   attributetypes: ( 1.3.6.1.4.1.42.2.27.4.1.6 NAME 
   'javaClassName' DESC 'Fully qualified name of 
   distinguished Java class or interface.' EQUALITY 
   2.5.13.5 SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 
   SINGLE-VALUE )

The following values are treated as different when matching values:

   javaClassName: com.example.MyClass
   javaClassName: com.example.Myclass

Restrictions:

The directory server does not support the use of an "extensible match" filter, which allows the matching rule to be specified as part of the search filter.

The directory server does not support the use of an ordering rule with sorted search requests. Sorted searches always use the matching rule defined for the attribute.



 
We're here to help

Easy ways to get the answers you need


How to buy

or call us at
1-866-883-8901


Quick links

IBM Directory Server

System i Online Library

System i and i5/OS Information Center

IBM Redbooks

PartnerWorld Education

System i Support