LS,

Net::LDAP::Schema has the capabilities of returning a definition of an attribute including matchingrules etc.

On the standard OL 2.2 schema this works fine for an attribute like email:

$VAR1 = {
         'equality' => 'caseIgnoreIA5Match',
         'name' => 'email',
         'oid' => '1.2.840.113549.1.9.1',
         'substr' => 'caseIgnoreIA5SubstringsMatch',
         'desc' => 'RFC2459: legacy attribute for email addresses in DNs',
         'aliases' => [
                        'emailAddress',
                        'pkcs9email'
                      ],
         'type' => 'at',
         'syntax' => '1.3.6.1.4.1.1466.115.121.1.26',
         'max_length' => '128'
       };

However when I ask for CN , I only get:

$VAR1 = {
'desc' => 'RFC2256: common name(s) for which the entity is known by',
         'sup' => [
                    'name'
                  ],
         'name' => 'cn',
         'oid' => '2.5.4.3',
         'aliases' => [
                        'commonName'
                      ],
         'type' => 'at'
       };

Now, I can ask for the definition of "name" and fetch the matching rules from there, or I can walk through all_matchingruleuses to see which one contains CN. Is there an easier way to accomplish this ? Or do I need to restructure the schema ;-) I'd like to use the returned matching rule in Net::LDAP::Filtermatch to determine the type of match.

Regards,

Hans


Reply via email to