[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: matching one character of a caseIgnoreIA5Match attribute

Alexander 'Leo' Bergolth wrote:

> I'm trying to filter entries that have the 'D' flag set in the
> sambaAcctFlags attribute:
> attributetype ( NAME 'sambaAcctFlags'
> 	DESC 'Account Flags'
> 	EQUALITY caseIgnoreIA5Match
> However, this attribute doesn't have a substring match rule, and normal
> substring filters don't seem to work.
> I don't know if that's possible on principle, but maybe an extensible
> search filter with a special matching rule can be used to accomplish
> this task?
> I've tried it with "(sambaAcctFlags:caseIgnoreSubstringsMatch:=*D*)" but
> substring filters are not allowed in extensible filters.
> Any hints?

You could implement a (trivial) "singleIA5charMatch" rule (few lines of
C code) and register it through a call to register_matching_rule()
within the init_module() call of a run-time loadable module, and use
that rule with an extensible filter on that attribute.  An example is
provided in ACI code (servers/slapd/aci.c) which registers run-time the
schema and matching rules related to in-object access checking (but your
code would be much more trivial).

In general, if this purpose is often required, and the structure of that
attribute has special meanings, you could implement a whole set of
specialized matching rules to inspect the attribute and extract relevant


Ing. Pierangelo Masarati
OpenLDAP Core Team

SysNet s.r.l.
via Dossi, 8 - 27100 Pavia - ITALIA
Office:  +39 02 23998309
Mobile:  +39 333 4963172
Email:   pierangelo.masarati@sys-net.it