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

Attribute rewriting in a metadirectory



Hi all,

Is there a way to rewrite the value of an attribute with OpenLDAP? I
want to add an "i" letter in front of the uid attribute of our users
preserving the old values. The uid of our users is numerical (7 digits):

dn: uid=2015446,o=org
objectClass: top,posixAccount,shadowAccount,sambaSamAccount
uid: 2015446
uidNumber: 9168
...

Now, we want another "view" of our directory, maintaining the old one.
The objects should look like this:

dn: uid=i2015446,o=org
objectClass: top,posixAccount,shadowAccount,sambaSamAccount
uid: i2015446
uidNumber: 9168
...

I've been able to change the dn with a metadirectory and this config:

database meta
suffix  "o=org"
uri ldap://host/o=org
rewriteEngine on
rewriteContext  searchResult
rewriteRule     "^uid=([0-9]{7})(,.*)$" "uid=i%1%2" ":"

As a result (note the uid attribute without "i"):

dn: uid=i2015446,o=org
objectClass: top,posixAccount,shadowAccount,sambaSamAccount
uid: 2015446
uidNumber: 9168
...

Does anybody knows how to change the value of an attribute? Is this
possible whith back-meta? I've read the man pages and googled around,
but there's not much documentation...

Thanks!


-- 
Albert Teixidó
SIEE - Suport Informàtic de l'Escola d'Enginyeries
UAB - Universitat Autònoma de Barcelona