[PATCH] Re: Plugable passdb (SAM) modules

Stefan (metze) Metzmacher metze at metzemix.de
Wed Jan 23 23:04:05 GMT 2002

I don't exactly now if I'm right, so correct me if not!

If the four builtin passdb modules are linked staticly. They are all loaded 
to memory if smbd is started. When smbd forks for each client, the code for 
the 4 modules are loaded in memory for each client.

500 clients = 500 * 4 = 2000 passdb modules are in memory and only 500 are 
realy used. if shared modules are in use the module is loaded only 1 time 
in memory!!!

I agree with that could be  a pain to get the modules in the right place , 
where they are found by smbd.

And the default for the builtin passdb modules must be static!

But to add an optional feature for poeple who want to save memory, must'nt 
be a problem.

And only if the user want, he can use shared modules for 

./configure                 ### with no args
-> smbpasswd and tdb are compiled static because they not need other libs 
to compile as LDAP done (use libldap.so and liblber.so) and i think nisplus 
is the same. Also the extern passdb module interface is activated if the OS 
supports it.

./configure --with-ldapsam --with-nisplussam
-> all four builtin in modules are compiled static and the option of extern 
modules is ativated if OS supports it!

Only if poeple who know what they do, they type:
./configure --with-ldapsam=shared --with-nisplussam
-> all modules are staic only ldap is compiled as shared module
and if the ./configure script detects that the OS not supports it, ldap 
would be compiled in static.

the modules should be place in  $(LIBDIR)/smbd or $/LIBDIR)/samba.

I think it doesn' t look so horrible, because the default is static for the 
builtin sam backends.


At 23:16 23.01.2002 +1100, you wrote:
>"Stefan (metze) Metzmacher" wrote:
> >
> > I think an option like
> > ./configure --with-smbpasswd=static \
> >                  --with-tdbsam=static  \
> >                  --with-ldapsam=shared \
> >                  --with-nisplus=shared
> > would be nice, so the user can decide at compile time witch modules are
> > static and witch have to be loaded via dlopen();
> > ./configure --enable-shared-sam-modules=yes
> > is the default on plattforms witch supports loaded modules
> > but you can disable it if you want!
> > ./configure --enable-shared-sam-modules=no
> >
>For the reason outlined so well just there...  It looks horrid!  The
>modules that come with samba should always be staticly compiled in - I
>see no *need* for them to be outside smbd.
>Also, I don't think samba will ever default to needing modules becouse
>it is such a pain to get right - you have to get smbd to look in the
>right places etc.  The current system 'just works' - while allowing
>other people to supply modules and do the legwork on getting smbd to
>find them.
>Andrew Bartlett
>Andrew Bartlett                                 abartlet at pcug.org.au
>Manager, Authentication Subsystems, Samba Team  abartlet at samba.org
>Student Network Administrator, Hawker College   abartlet at hawkerc.net
>http://samba.org     http://build.samba.org     http://hawkerc.net


Stefan "metze" Metzmacher <metze at metzemix.de>

More information about the samba-technical mailing list