[1928] in Kerberos_V5_Development
Change to allow MEMORY: ccache type to be used
daemon@ATHENA.MIT.EDU (Michael Graff)
Fri Nov 8 00:32:40 1996
Date: Fri, 8 Nov 1996 00:32:23 -0500 (EST)
From: Michael Graff <explorer@flame.org>
To: krbdev@MIT.EDU
Due to a project I was given to work on, I had need of the memory
ccache. However, it appears it needs to be explicitly registered
by any application wanting to use it.
I made a change to lib/krb5/ccache/ccbase.c to construct a linked list
of methods (created at compile-time, krb5_cc_register() can still append
to this list) with one of (fcc, scc) first followed by the mcc memory
ccache.
It seems this might be one more item to get into the MIT tree. Here are
the diffs from Cygnus's code:
Index: ccbase.c
===================================================================
RCS file: /cvs/cvsfiles/krb5/lib/krb5/ccache/ccbase.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ccbase.c 1996/06/27 23:27:29 1.2
+++ ccbase.c 1996/11/08 00:18:57 1.3
@@ -26,14 +26,32 @@
#include "k5-int.h"
-extern krb5_cc_ops *krb5_cc_dfl_ops;
struct krb5_cc_typelist
{
krb5_cc_ops *ops;
struct krb5_cc_typelist *next;
};
-static struct krb5_cc_typelist *cc_typehead = 0;
+extern krb5_cc_ops krb5_mcc_ops;
+
+static struct krb5_cc_typelist cc_entry_2 = { &krb5_mcc_ops, NULL };
+
+#ifdef HAVE_SYS_TYPES_H
+/* Systems that have <sys/types.h> probably have Unix-like files (off_t,
+ for example, which is needed by fcc.h). */
+
+#include "fcc.h" /* From file subdir */
+krb5_cc_ops *krb5_cc_dfl_ops = &krb5_cc_file_ops;
+static struct krb5_cc_typelist cc_entry_1 = { &krb5_cc_file_ops, &cc_entry_2 };
+#else
+/* Systems that don't have <sys/types.h> probably have stdio anyway. */
+
+#include "scc.h" /* From stdio subdir */
+krb5_cc_ops *krb5_cc_dfl_ops = &krb5_scc_ops;
+static struct krb5_cc_typelist cc_entry_1 = { &krb5_cc_scc_ops, &cc_entry_2 };
+#endif
+
+static struct krb5_cc_typelist *cc_typehead = &cc_entry_1;
/*
* Register a new credentials cache type
* If override is set, replace any existing ccache with that type tag
@@ -110,8 +128,8 @@
}
}
if (krb5_cc_dfl_ops && !strcmp (pfx, krb5_cc_dfl_ops->prefix)) {
- free (pfx);
- return (*krb5_cc_dfl_ops->resolve)(context, cache, resid);
+ free (pfx);
+ return (*krb5_cc_dfl_ops->resolve)(context, cache, resid);
}
free(pfx);
return KRB5_CC_UNKNOWN_TYPE;
with the file ccdefops.c removed.
--Michael