linked attributes, DRS and abusing the ldb modules API

simo idra at samba.org
Wed Aug 26 06:44:34 MDT 2009


On Wed, 2009-08-26 at 22:22 +1000, tridge at samba.org wrote:
> Hi Simo,
> 
>  > 4) instead of doing a ldb_next_request() call you do a normal
>  > ldb_request() call that goes through the whole stack to perform the
>  > modify operation you received.
>  > 
>  > If we need to skip modules in this special case we could use a control
>  > to signal other modules should ignore this request. IMO this approach
>  > would be a lot less problematic.
> 
> That would mean having special case code in every module, instead of
> having the special case code in only one place. I think that would be
> very hard to maintain.

I was thinking of a control all modules know about that lists which
modules it is interested in.
Alternatively an extended operation would also be possible and this
would interest only the specific module.
In any case we first need to see if control or ex-op are even necessary.
In many cases you can just do a normal ldb_request() without any
side-effect to care about.

>  > Including ldb_private.h is a violation of the interface, we've gone
>  > through great pains to remove any access to ldb_private.h from all code
>  > except internal ldb code.
> 
> If we decide to go ahead with this module chaining approach we can
> expose ldb_load_modules_list() or an equivalent function via
> ldb_module.h.

Yes, this is certainly possible, although I do not like to let modules
play these magic tricks. I think it would be easy to trip over if a
module expects to be called in a specific order and ends up being pulled
in somewhere else.
If at all possible my 2 preferred options would be to a) change the repl
module order or b) do an ldb_request()

> For now I want to get the basic model right. For that I suspect I'm
> going to need some input from Metze, as I'm not really sure exactly
> what modules we do/don't want exposed to the DRS replication requests.

Sure didn't mean to discard the patch just for the header, just to point
out that you need to expose the right function in ldb_module.h and not
include ldb_private.h

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer <simo at samba.org>
Principal Software Engineer at Red Hat, Inc. <simo at redhat.com>



More information about the samba-technical mailing list