Alexander 'Leo' Bergolth wrote:
I'm trying to filter entries that have the 'D' flag set in the sambaAcctFlags attribute:
attributetype ( 1.3.6.1.4.1.7165.2.1.26 NAME 'sambaAcctFlags' DESC 'Account Flags' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{16} SINGLE-VALUE )
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 information.
p.
Ing. Pierangelo Masarati OpenLDAP Core Team
SysNet s.r.l. via Dossi, 8 - 27100 Pavia - ITALIA http://www.sys-net.it --------------------------------------- Office: +39 02 23998309 Mobile: +39 333 4963172 Email: pierangelo.masarati@sys-net.it ---------------------------------------