order of idmap backends

Stefan (metze) Metzmacher metze at metzemix.de
Thu Jun 26 06:18:36 GMT 2003


At 20:51 25.06.2003 +0000, Jeremy Allison wrote:
>On Wed, Jun 25, 2003 at 10:39:14PM +0200, Stefan (metze) Metzmacher wrote:
> > At 20:32 25.06.2003 +0000, Jeremy Allison wrote:
> > >On Wed, Jun 25, 2003 at 10:24:06PM +0200, Stefan (metze) Metzmacher wrote:
> > > > Hi Jeremy,
> > > >
> > > > why did you change DLIST_ADD() to DLIST_ADD_END() ?
> > > >
> > > > in smb_register_idmap()
> > > >
> > > > why is the order important?
> > > >
> > > > we should have this in sync with the other smb_register_*() 
> functions!!!
> > >
> > >Because I thought the order was important. It *should* be !
> > >This is very broken right now....
> >
> > I think it's not impartant and also should not be important!!!
> > (we just search in a linked list and it doesn't matter on which position
> > and list element is!)
> >
> > and I can't see were it's broken.
>
>Because smbd should be asking winbind, not doing anything directly
>in idmap. winbind should be looking in the tdb, with ldap as a remote
>backend.
>
>This code has been written to be generic, when it *ISN'T* generic.
>The is and should be an ordering in this.

You're right that the calls to the local and remote idmap backend should be 
ordered!

But that has nothing todo with smb_register_idmap() !
this just adds a new backend to the list of possibly available backends!

What you want is in idmap_init() NOT in smb_register_idmap().

please search there for bugs and revert the smb_register_idmap() to use 
DLIST_ADD() again please! (even if it's just for be integrative along all 
smb_register_*() functions .-)

this works perfect in all other subsystems there's really no reason why 
DLIST_ADD_END() should be better.

there's also a reason  why DLIST_ADD() is better:
if we load a shared idmap backend we'll run e.g:
smb_probe_module("idmap","mysql");
this will load the module which will call smb_register_idmap() and this 
should add it to the start of the LIST.
then we call get_methods("mysql") and this will directly find the function 
pointer array at the start of the LIST...


So please look at  "init_idmap()" :-)



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




More information about the samba-technical mailing list