[PATCH] Rework S3 DEBUG system, impact on libsmbclient

Andrew Bartlett abartlet at samba.org
Mon Nov 1 18:18:01 MDT 2010


Derrell,

I've reworked the Samba3 debug system, to make it more self-contained
(no longer exposing global static variables, for example) and to ease a
merge between the s3 and s4 implementations.  This included a change in
the handling of smbc_set_option(ctx, "debug_to_stderr", 1) and
smbcSetDebugToStderr(ctx, 1).

These now only work once per process, and cannot be reset to 0.
Internally, a 'ratchet' operates on the global debug state to avoid
sending debug messages to stdout, once any part of Samba (or a
libsmbclient caller) requests error output on stderr.  

The reason for this is to ensure that we do no pollute stdout if we have
been asked not to, because previously a second libsmbclient startup (a
second thread or second context) would change the debug destination back
again.  

The code asks that we might get a per-thread debug 'dbf' at some point,
but this hasn't happened since, so I think this is the most appropriate
way to deal with this for the time-being.  (and per-thread wouldn't
particular help with multiple contexts anyway)

Is this an OK change in behaviour?

The behaviour changes in the first patch, while the last two tidies up
details so that the behaviour is clear to the caller. 

(Jelmer and Tridge have already reviewed these patches, and Jelmer
requested that I ask you about the libsmbclient change, while Tridge
asked that I conduct lot's of testing, which I have done). 

Andrew Bartlett
-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Cisco Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s3-debug-Impove-setup_logging-to-specify-logging-to-.patch
Type: text/x-patch
Size: 33838 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20101102/0a28dc56/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-s3-debug-Remove-AllowDebugChange-and-use-lp_set_cmdl.patch
Type: text/x-patch
Size: 13972 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20101102/0a28dc56/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-s3-debug-Remove-last-direct-assignements-to-DEBUGLEV.patch
Type: text/x-patch
Size: 3302 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20101102/0a28dc56/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-s3-debug-Convert-from-x_file-to-real-file-descriptor.patch
Type: text/x-patch
Size: 6710 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20101102/0a28dc56/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-s3-debug-Move-load_case_tables-before-lp_set_cmdline.patch
Type: text/x-patch
Size: 4454 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20101102/0a28dc56/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-s3-debug-Clarify-the-handling-of-invalid-state.fd-va.patch
Type: text/x-patch
Size: 3153 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20101102/0a28dc56/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-debug-Explain-the-behaviour-of-setup_logging-more-cl.patch
Type: text/x-patch
Size: 2820 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20101102/0a28dc56/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-s3-libsmbclient-examples-Add-tests-for-debug-behavio.patch
Type: text/x-patch
Size: 1241 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20101102/0a28dc56/attachment-0007.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0009-s3-libsmbclient-Add-comments-to-describe-the-behavio.patch
Type: text/x-patch
Size: 3890 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20101102/0a28dc56/attachment-0008.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20101102/0a28dc56/attachment.pgp>


More information about the samba-technical mailing list