[krbdev.mit.edu #2657] krb5_init_context() calls into the CCAPI via krb5_cc_set_default_name()
Alexandra Ellwood via RT
rt-comment at krbdev.mit.edu
Fri Aug 6 16:46:53 EDT 2004
Currently krb5_init_context() calls into CCAPI when it resets the ccache name in the context.
It does this by calling krb5_cc_set_default_name(context, NULL).
krb5_cc_set_default_name(context, NULL) sets the ccache name in the context to its "default"
value by calling get_from_os(). On CCAPI platforms it calls
cc_context_get_default_ccache_name().
The problem is that cc_context_get_default_ccache_name() produces an IPC call. This means
that you pay for the overhead of an IPC call just for initializing a context. It also means that
the CCAPI server needs to be present to answer the request, even though the context may
never use the ccache.
I would like to change the behavior so that it lazily looks up the default ccache. Basically
when you call krb5_cc_set_default_name(context, NULL), it will just set the ccache name in
the context to the NULL string and free the old one. When you call
krb5_cc_default_name(context), it will look at the environment variable and then call
get_from_os(). Basically I just want to defer the actual work to when the library needs to look
up the ccache name.
Although this changes when the default ccache is looked up, I can't think of any practical
problems with it based on how callers use krb5_contexts
More information about the krb5-bugs
mailing list