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

Re: Ang. RE: Bdb defaults - WAS: problem importing entries.



> Pierangelo Masarati wrote:
> | You see, I madew my own set of mistakes; this
> |
> |
> |>access to dn.regex="^(.+,)?ou=.+,(dc=.+,?)+$"
> |
> |
> | should have actually been
> |
> | access to dn.regex="^(.+,)?ou=.+,(dc=[^,]+)+$"
> |
> | in any case far from
>
> Surely we need to allow (but not require) commas in there in the case of
> multiple dc entries, so how about:
> access to dn.regex="^(.+,)?ou=[^,]+,(dc=[^,]+,?)+$"
> (still need to test it more myself)
>
> (assuming we want the "who"'s in this clause to be able to add entries
> to the ou and write to anything below the ou's to any depth they like).

This is as far as I can get:

access to dn.regex="^(.+,)?ou=[^,]+,(dc=[^,]+(,dc=[^,]+)*)$"

it requires at least one "dc=value" and allows for more, and stores in
"$2" the whole "domain" part of the DN, for subsequent replacement.

Using:

1) ou=People,dc=ldap,dc=example,dc=com
2) cn=ando,ou=People,dc=ldap,dc=example,dc=com
3) cn=ando,ou=People,dc=example,dc=com
4) cn=ando,ou=People,dc=com

as inputs, which should entail all the interesting cases

access to dn.regex="^(.+,)?ou=[^,]+,(dc=[^,]+,?)+$"

matches in all cases, but submatch "$1" is always "cn=ando," except for
input 1), while submatch "$2" is always "dc=com" which is not what you
meant, I think.  With

access to dn.regex="^(.+,)?ou=[^,]+,(dc=[^,]+(,dc=[^,]+)*)$"

all cases match, and the submatches are:

"$1" always "cn=ando," except, of course, 1);
"$2" is "dc=ldap,dc=example,dc=com" in cases 1) and 2), while "$2" is
"dc=example,dc=com" in case 3) and "dc=com" in case 4), which is what we
expected, as I assume, i.e. having a domain-style naming context entirely
matched.

You may use http://www.sys-net.it/~ando/Download/regex.c to test it.

> |
> |
> |>>>access to dn="(.+,)?,ou=.+,(dc=.+,?)+$$"
>
> BTW, there are still examples in 2.2.13's slapd.access(5) with $$ in the
> target:

must have slipped thru...

p.

-- 
Pierangelo Masarati
mailto:pierangelo.masarati@sys-net.it


    SysNet - via Dossi,8 27100 Pavia Tel: +390382573859 Fax: +390382476497