Skip Menu |
 

Subject: krb5_init_context() calls into the CCAPI via krb5_cc_set_default_name()
Download (untitled) / with headers
text/plain 1.2KiB
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
From: lxs@mit.edu
Subject: CVS Commit
ccdefname.c (krb5_cc_set_default_name, krb5_cc_default_name): Look up the default ccache name in krb5_cc_default_name, not krb5_cc_set_default_name so that krb5_init_context doesn't have to do work it might never use.


To generate a diff of this commit:



cvs diff -r5.45 -r5.46 krb5/src/lib/krb5/os/ccdefname.c
From: lxs@mit.edu
Subject: CVS Commit
ccdefname.c (krb5_cc_set_default_name, krb5_cc_default_name): Look up the default ccache name in krb5_cc_default_name, not krb5_cc_set_default_name so that krb5_init_context doesn't have to do work it might never use.


To generate a diff of this commit:



cvs diff -r5.395 -r5.396 krb5/src/lib/krb5/os/ChangeLog