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

Question regarding rewrite rules (slapd-ldap backend)


I'm using OL 2.2.26 (Debian unstable). My goal is to configure a LDAP proxy. 
I'm using the slapd-ldap backend. The basic configuration of the proxy is OK.
LDAP searches are perfectly forwarded from the proxy to the master LDAP server 
(on which I do not have any particular administrative right).  This part 
works perfectly well. However in order to simplify interoperabilty between 
clients behind the proxy and information stored into the master LDAP (which I 
cannot change) I want to rewrite on the fly some attributes (not the name of 
attributes, but the values carried by attributes). More precisely, the 
homeDirectory attribute has the following pattern /private/d1/d2/login (into 
the master LDAP server) which I would like to change into /home/login. So 
clients behind the proxy server would see different homeDirectory attributes.

I have been trying to use the rewriteEngine. However I have the feeling that 
it does not work. Here is a fragment of the configuration file I have written 
in order to rewrite the homeDirectory attribute (posixAccount schema):

database ldap
lastmod off
suffix "<suffix>"
uri "ldap://<host>"

rewriteEngine on
rewriteContext searchResult
rewriteRule "(homeDirectory.*)/([a-zA-Z0-0-9]+)$" "%1/home/%2" :@

It does not work. So my  question is simple is it possible  to modify on the 
fly attributes values of search result ?

Best regards,

Frederic Tronel.