[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: slapo-rwm and rewriteRules
RaphaÃl 'SurcouF' Bordet wrote:
You've probably misunderstood my request.
An example will be more efficient :
I've some entries like this:
dn: uid=raphael.bordet,dc=xxx,dc=yy
objectclass: top
objectclass: person
uid: raphael.bordet
mail: raphael.bordet@microsoft.com
I want to translate this entrie to this :
ïdn: ïmail=raphael.bordet@microsoft.com,dc=xxx,dc=yy
objectclass: top
objectclass: person
uid: raphael.bordet
mail: raphael.bordet@microsoft.com
How can I do this ?
You need something like
database relay
suffix "o=Example,c=US"
relay "dc=example,dc=com"
overlay rwm
rwm-rewriteEngine on
rwm-rewriteMap ldap mail2uid
"ldap://:9011/dc=example,dc=com?uid?sub"
rwm-rewriteMap ldap uid2mail
"ldap://:9011/dc=example,dc=com?mail?sub"
rwm-rewriteContext default
rwm-rewriteRule "^(.+,)?(mail=[^,]+),o=Example,c=US$"
"$1uid=${mail2uid($2)},dc=example,dc=com" ":@I"
rwm-rewriteRule "^(.+,)?o=Example,c=US$"
"$1dc=example,dc=com" ":@I"
rwm-rewriteContext searchEntryDN
rwm-rewriteRule "^(.+,)?(uid=[^,]+),dc=example,dc=com$"
"$1mail=${uid2mail($2)},o=Example,c=US" ":@I"
rwm-rewriteRule "^(.+,)?dc=example,dc=com$"
"$1o=Example,c=US" ":@I"
but it's ugly and inefficient. See slapo-rwm(5) for details.
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
---------------------------------------