ccbase.c patch to support multiple ccache types (was Re: How to prevent very very large ccaches?)
Nicolas Williams
Nicolas.Williams at ubsw.com
Wed Jun 19 12:16:09 EDT 2002
Here's a preliminary patch which allows me to use FILE and STDIO.
I don't know what #ifdefs I might need to ensure ccbase.c patched as
follows will compile things link on MacOS and Windows... Comments?
Why wasn't this already in there??
Nico
Index: LOCAL-122.13/lib/krb5/ccache/ccbase.c
--- LOCAL-122.13/lib/krb5/ccache/ccbase.c Wed, 14 Mar 2001 14:20:32 -0500
+++ LOCAL-122.13(w)/lib/krb5/ccache/ccbase.c Wed, 19 Jun 2002 12:10:42 -0400
@@ -35,8 +35,10 @@
struct krb5_cc_typelist *next;
};
extern krb5_cc_ops krb5_mcc_ops;
+extern krb5_cc_ops krb5_fcc_ops;
+extern krb5_cc_ops krb5_scc_ops;
-static struct krb5_cc_typelist cc_entry = { &krb5_mcc_ops, NULL };
+static struct krb5_cc_typelist cc_entry = { &krb5_mcc_ops, NULL};
static struct krb5_cc_typelist *cc_typehead = &cc_entry;
@@ -89,6 +91,7 @@
char *pfx, *cp;
const char *resid;
int pfxlen;
+ int tries = 1;
cp = strchr (name, ':');
if (!cp) {
@@ -110,6 +113,7 @@
*cache = (krb5_ccache) 0;
+loop:
for (tlist = cc_typehead; tlist; tlist = tlist->next) {
if (strcmp (tlist->ops->prefix, pfx) == 0) {
free(pfx);
@@ -119,6 +123,13 @@
if (krb5_cc_dfl_ops && !strcmp (pfx, krb5_cc_dfl_ops->prefix)) {
free (pfx);
return (*krb5_cc_dfl_ops->resolve)(context, cache, resid);
+ }
+ if (tries) {
+ krb5_cc_register(context, &krb5_mcc_ops, 0);
+ krb5_cc_register(context, &krb5_fcc_ops, 0);
+ krb5_cc_register(context, &krb5_scc_ops, 0);
+ tries--;
+ goto loop;
}
free(pfx);
return KRB5_CC_UNKNOWN_TYPE;
On Wed, Jun 19, 2002 at 11:42:34AM -0400, Nicolas Williams wrote:
> Funny, I keep getting "Unknown credential cache type while getting
> default ccache" whenever I try KRB5CCNAME=STDIO:/path/to/ccache. But the
> stdio ccache is actually compiled in, it's in the library. Hmmm...
>
> Nico
--
-DISCLAIMER: an automatically appended disclaimer may follow. By posting-
-to a public e-mail mailing list I hereby grant permission to distribute-
-and copy this message.-
Visit our website at http://www.ubswarburg.com
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.
E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses. The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission. If
verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.
More information about the Kerberos
mailing list