The Samba-Bugzilla – Bug 11036
No option to set where debugging goes prior to calling smbc_new_context()
Last modified: 2015-01-07 10:34:19 UTC
libsmb offers the possibility to set up debugging using smbc_setOptionDebugToStderr() but only after a context has been established with smbc_new_context().
However, smbc_new_context() can still emit log messages, which, combined with "log level" setting in smb.conf might lead to stdout output which cannot be easily suppressed.
It would be better to offet some way to set up logging target prior to creating a new context -- via some "global" call like smbc_global_debug_to_stderr() or even some environment variable.
btw see https://fedorahosted.org/sssd/ticket/2544 for a real-world consequence.
I should also add that I'm fine with contributing a fix if there's a consensus if and how to fix the problem.