[PATCH] Re: Plugable passdb (SAM) modules

Simo Sorce idra at samba.org
Wed Jan 23 09:21:21 GMT 2002


I agree, I had in mind exactly this model.

On Wed, Jan 23, 2002 at 01:07:18PM +0100, 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
> 
> the init functions should look like this:
> 
> #ifdef WITH_TDBSAM
> ...
> tdbsam_pdb_functions()
> ...
> #ifdef WITH_TDBSAM_STATIC
> NTSTATUS pdb_init_ldapsam(PDB_CONTEXT *pdb_context, PDB_METHODS **pdb_method)
> #endif /* WITH_TDBSAM_STATIC */
> #ifdef WITH_TDBSAM_SHARED
> /* the "init" function is load via dlopen() */
> NTSTATUS init (PDB_CONTEXT *pdb_context, PDB_METHODS **pdb_method)
> #endif /* WITH_TDBSAM_SHARED */
> {
>          NTSTATUS nt_status;
> 
>          if (!NT_STATUS_IS_OK(nt_status = 
> make_pdb_methods(pdb_context->mem_ctx, pdb_method))) {
>                  return nt_status;
>          }
> 
>          (*pdb_method)->setsampwent = tdbsam_setsampwent;
>          (*pdb_method)->endsampwent = tdbsam_endsampwent;
>          (*pdb_method)->getsampwent = tdbsam_getsampwent;
>          (*pdb_method)->getsampwnam = tdbsam_getsampwnam;
>          (*pdb_method)->getsampwrid = tdbsam_getsampwrid;
>          (*pdb_method)->add_sam_account = tdbsam_add_sam_account;
>          (*pdb_method)->update_sam_account = tdbsam_update_sam_account;
>          (*pdb_method)->delete_sam_account = tdbsam_delete_sam_account;
> 
>          /* TODO: Setup private data and free */
> 
>          (*pdb_method)->private_data = talloc(pdb_context->mem_ctx, 
> sizeof(struct tdb_enum_info));
> 
>          if (!(*pdb_method)->private_data) {
>                  return NT_STATUS_NO_MEMORY;
>          }
> 
>          (*pdb_method)->free_private_data = free_private_data;
> 
>          return NT_STATUS_OK;
>   }
>   ....
> #endif /* WITH_TDBSAM */
> 
> 
> metze
> 
> At 01:21 23.01.2002 -0800, you wrote:
> >Yes, there are platforms that do not like loadable libraries, but for these
> >platforms we only need a few #ifdefs to compile the needed module 
> >statically, the same way we have done till now.
> >
> >On Wed, Jan 23, 2002 at 10:49:32AM +1100, Andrew Bartlett wrote:
> > > Simo Sorce wrote:
> > > >
> > > > Absolutely the dlopen() is the way to go in the last!
> > > >
> > > > I would prefer to have all modules loaded as "extern"!
> > >
> > > I don't think this will happen.  We still have platforms that makes this
> > > a pain (or so I'm told) and its easier to just keep these staticly
> > > linked.  But where we support it, I certainly don't object - for new
> > > external modules.
> > >
> > > 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
> > >
> >
> >--
> >Simo Sorce       idra at samba.org
> >-------------------------------
> >Samba Team http://www.samba.org
> 
> MfG
> metze
> 
> Stefan "metze" Metzmacher <metze at metzemix.de>
> 
> 

-- 
Simo Sorce       idra at samba.org
-------------------------------
Samba Team http://www.samba.org




More information about the samba-technical mailing list