mechglue debugging

Greg Hudson ghudson at MIT.EDU
Mon Mar 21 10:32:16 EDT 2011

On Mon, 2011-03-21 at 10:11 -0400, Sam Hartman wrote:
> >>>>> "Luke" == Luke Howard <lukeh at> writes:
>     Luke> The mechglue could really do with some debug statements for
>     Luke> when mechanism plugins do not load. What's the right way to do
>     Luke> logging from within a library? I basically plan to just
>     Luke> uncomment the existing syslog() calls, but obviously there's a
>     Luke> more appropriate way otherwise they wouldn't be commented out.
> Take a look at src/include/k5-trace.h

That framework requires a krb5 context (so it can turn off tracing for
secure contexts, and so it can allow app control of tracing).  Not so
useful for the mechglue in its current form.

At some point I would like to introduce the Heimdal concept of the
per-thread GSSAPI krb5 context, and (unlike Heimdal, I think) give the
app a way to specify and control it.  After that it would be possible to
make an internal GSSAPI trace logging framework which references the
per-thread GSSAPI krb5 context.

As for Luke's original question, there's no really easy standard way to
log from a library as far as I know.  Some Unix libraries syslog, but I
can kind of see why that hasn't really caught on, and it's not an option
on Windows.  I've seen people advocate log4c, but I'm not wild about
adding a new dependency to our implementation and I've seen implementors
of other libraries raise the same objection.

More information about the krbdev mailing list