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

loadable module support

[I sent the message below to openldap-software by accident, apologies
for the inconvinience.]

Hi ,

I'm currently writing a new backend to LDAP-enable the userdatabase
server in use at Lifeline. For development speed and flexibilty I
thought it would be nice if OpenLDAP supports dynamically loadable
modules, like Apache has. This way one could simply enable specific
backends, authentication methods or features (e.g. phonetic) in the
config file.
Currently I've a small patch that allows a line in slapd.conf like:

loadmodule    /opt/ldap/modules/backcorba.so

This will load any shared object regardless of its function. It's up to
the module to register itself upon initialization. So far I've only
patched backend.c and some backends to allow for dynamic backend
loading. The ugly if-then list in new_backend() is replaced by a lookup
in a hashtable. This yields a pointer to a function that will set the
appropiate hooks in the Backend structure. The init method of the
backend modules adds the entry to the hashtable. I haven't included
support for other modules yet. First I would like to receive some
feedback on my approach. Specifically my patches require glib/gmodule
for the loadable module support and the hashtable. In my opinion glib (a

independently maintained spinoff of GTK/GNOME) is a great library for
doing stuff like this in a platform independent way. Secondly, I'm no
autoconf guru, so I anyone would like to help me incorporate the
required changes in the build configuration (for example
conditiotionally include -rdynamic in the CFLAGS), that would be
appreciated very much. It's my intentiation to leave the loadable module

support completely optional (switchale with ./configure).
Please let me know what you think!


Bastiaan Bakker

begin:          vcard
fn:             Bastiaan Bakker
n:              Bakker;Bastiaan
org:            LifeLine Networks BV
email;internet: Bastiaan.Bakker@lifeline.nl
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
version:        2.1
end:            vcard