Samba DEBUG in OpenChange

Jelmer Vernooij jelmer at openchange.org
Sun Dec 13 13:10:19 UTC 2015


On Sat, Dec 12, 2015 at 05:51:05PM -0800, Jeremy Allison wrote:
> On Sat, Dec 12, 2015 at 04:35:28PM +0000, Jelmer Vernooij wrote:
> > On Wed, Dec 09, 2015 at 06:43:53AM +0100, Volker Lendecke wrote:
> > > On Wed, Dec 09, 2015 at 02:13:00AM +0000, Jelmer Vernooij wrote:
> > > > Sorry, but the point of this e-mail thread escapes me. You asked
> > > > us what we need to fix compatibility with newer versions of Samba, and
> > > > now you don't like the answer you're telling us we should just fork
> > > > and go away?
> > > 
> > > Initially I thought the issue is mainly about debug. During the thread I
> > > realized that the integration goes a lot further, OpenChange has a much
> > > deeper dependency on Samba iternals than I had initially realized. Today
> > > it's about debug, tomorrow it will be some libndr aspect and next week
> > > it will be something else. I am just worried that we will break your
> > > builds in the future without knowing again and again. This is what led
> > > me to think a fork is your best bet.
> > 
> > OpenChange only depends on two or three dozen functions in Samba,
> > exposed through various libraries. We're trying to get it down to just DCE/RPC/NDR.
> > 
> > At the moment we use:
> > 
> >  * DEBUG, as it's inherently tied to the rest of Samba
> >  * DCE/RPC client and server libraries
> >   + NDR
> >   + pidl
> >  * LoadParm (mostly lpcfg_parm_{string,bool})
> >  * Service registration in the daemon
> > 
> > We have concrete plans to migrate away from both DEBUG and LoadParm, but
> > for that the DCE/RPC and NDR libraries in Samba that we use will need
> > to be able to work without DEBUG.
> 
> So as far as I can see it's the DEBUGXXX() functions
> inside ndr_print_debug_XXX() functions that are causing
> the problem - yes ?

See
https://raw.githubusercontent.com/openchange/openchange/master/doc/developer/logging.txt
for the current plan.

We need an override for DEBUG on a per-NDR and per DCE/RPC-server
context basis ideally.

A global override for the DEBUG functions means that output from *all*
DEBUG() calls will be redirected, not just those related to OpenChange
DCE/RPC calls. OpenChange (currently) loads into the samba server,
meaning all logging (even for lsa, samr, etc) would go to the
OpenChange logs when OpenChange is loaded.

> Why not just replace these functions calls with
> ones that go through a global vector that can be
> overwritten.
> 
> On startup Samba writes in the functions it uses
> (dbgtext() and friends) and OpenChange writes in
> it's functions.
This adds an extra level of indirection in Samba, but it exposes the
same number of internals (debugtext() and friends) to the outside
world. From the Samba perspective, I don't see how this is an
improvement over the previous situation where debugtext() et al were
public and called directly by OpenChange.

Cheers,

Jelmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20151213/5f6be26c/signature.sig>


More information about the samba-technical mailing list