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

set-based constraint for prefix



HI!

Maybe I'm overlooking something obvious...

I'd like to enforce a prefix naming convention by using a set-based constraint.
The idea is that 'cn' value of an entry should *start* with the 'cn' value of
the superior entry and a hyphen.

Example with Superior entry has 'cn: example':
example-foo -> accept
examplefoo -> disallow
foo-bar -> disallow

My problem is the "start with" since I cannot find a way to express the
wildcard string in a set.

The following does not work since [*] is interpreted literally so only the
exact value 'example-*' is accepted:

# 'cn' has to use superior entry's 'cn' value as prefix
constraint_attribute cn set
  "(this/-1/cn + [-] + [*] ) & this/cn"
 
restrict="ldap:///ou=ampua??sub?(|(objectClass=mySrvGroup)(objectClass=myGroup))"

Any help is appreciated.

Ciao, Michael.