Howard Chu wrote:
ando@sys-net.it wrote:
ando@OpenLDAP.org wrote:
Log Message: open database using the real structure (partial fix to ITS#5724)
We need a virtual database to inherit controls from the real database. Sharing the array of known controls could be a solution, but it wouldn't allow the virtual database to have specific controls, e.g. registered by an overlay. A solution would be to let the real database know it's related to virtual ones, so that modifications to the real database via back-config can be propagated to the virtual ones. This, of course, poses the problem that if a virtual database is deleted, any reference to it must be removed from the list of related databases. I wonder if all of this is worth the effort of exposing real controls by the virtual database.
Since a single relay database may be configured to multiplex to many other databases, and they may not all support the same set of controls, this seems to be an exercise in futility. I guess it may be OK to just advertise a union of all the real database controls, and perform an extra restriction check before handing off processing.
Sharing the pointer to the supported controls would allow to use the actual set. Something along the line
struct BackendDB { char be_ctrlsbuf[SLAP_MAX_CIDS + 1]; char *be_ctrls; };
All backends would have be_ctrls = be_ctrlsbuf, but back-relay would set it to NULL, and temporarily set it to the relayed database's be_ctrlsbuf for the duration of an operation. Modules wouldn't be able to register new controls because the pointer is null otherwise.
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 Fax: +39 0382 476497 Email: ando@sys-net.it -----------------------------------