Samba DEBUG in OpenChange

Jeremy Allison jra at
Mon Dec 14 18:42:13 UTC 2015

On Sun, Dec 13, 2015 at 01:10:19PM +0000, Jelmer Vernooij wrote:
> See
> 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.

Well it actually doesn't expose the internals - as
if calling these functions is vectored, and we
don't export the functions we plug into that
vector - then you can't get to them (unless
you do really dirty things like copy the
pointer we plug in :-). You can only plug
in your own function instead.

More information about the samba-technical mailing list