[PATCH] Fix bug 13465

Christof Schmitt cs at samba.org
Thu Aug 16 23:21:25 UTC 2018


On Thu, Aug 16, 2018 at 07:46:49AM +0200, Volker Lendecke wrote:
> On Wed, Aug 15, 2018 at 02:40:48PM -0700, Christof Schmitt via samba-technical wrote:
> > Sharing the common code is good, but i am wondering if the post hook in
> > popt is the best place for that. Right now i am exploring whether a
> > cleaner approach would be:
> >  
> >  - Move the complex calls from the post hook to a helper function that
> >    can be called from the cmdline tools (there is already
> >    source3/lib/util_cmdline.c which might be a good place).
> >  - Introduce a new cmdline_contexts.c, similar to server_contexts, but
> >    with the additional checks for cmdline tools.
> >  - That would require introducing a "set" function for the messaging
> >    context used in db_open.
> 
> Thanks for looking into that mess! On your last point -- what would
> that mean? Being able to change a messaging context on an existing
> db_context?

I was thinking of having a static messaging_context pointer in
dbwrap_open.c and having to initialize that.

The second option would be passing down the messaging context as
arguments, but that might get tricky with shared libraries.

And the third option would be going back to having only one "common"
messaging context and just add cmdline wrapper functions to initialize
the common context with proper error handling.

Christof



More information about the samba-technical mailing list