set_ccache.c (gss_krb5_ccache_name): Added new Krb5 specific interface
authorTheodore Tso <tytso@mit.edu>
Fri, 12 Mar 1999 00:16:47 +0000 (00:16 +0000)
committerTheodore Tso <tytso@mit.edu>
Fri, 12 Mar 1999 00:16:47 +0000 (00:16 +0000)
to set the default credentials cache name.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11266 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/krb5/ChangeLog
src/lib/gssapi/krb5/Makefile.in
src/lib/gssapi/krb5/set_ccache.c [new file with mode: 0644]

index 8f3f616c1d3a3863cd21ea1c85c10ed71c9a214b..a7538745fc2f721b801477c26c7aeed259b92bff 100644 (file)
@@ -1,3 +1,8 @@
+1999-03-11  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+       * set_ccache.c (gss_krb5_ccache_name): Added new Krb5 specific
+               interface to set the default credentials cache name.
+
 1999-02-19  Theodore Ts'o  <tytso@rsts-11.mit.edu>
 
        * Makefile.in (DLL_FILE_DEF): Tell the Makefile template that we
index ad8aa1d47f1c677024c3e4b92668dba9730d9a33..b1bfc1d5cca2be93686d9a39b450956d72eca137 100644 (file)
@@ -51,6 +51,7 @@ SRCS = \
        $(srcdir)/rel_name.c \
        $(srcdir)/seal.c \
        $(srcdir)/ser_sctx.c \
+       $(srcdir)/set_ccache.c \
        $(srcdir)/sign.c \
        $(srcdir)/unseal.c \
        $(srcdir)/util_cksum.c \
@@ -98,6 +99,7 @@ OBJS = \
        rel_name.$(OBJEXT) \
        seal.$(OBJEXT) \
        ser_sctx.$(OBJEXT) \
+       set_ccache.$(OBJEXT) \
        sign.$(OBJEXT) \
        unseal.$(OBJEXT) \
        util_cksum.$(OBJEXT) \
diff --git a/src/lib/gssapi/krb5/set_ccache.c b/src/lib/gssapi/krb5/set_ccache.c
new file mode 100644 (file)
index 0000000..a643ed6
--- /dev/null
@@ -0,0 +1,25 @@
+#include "gssapiP_krb5.h"
+
+OM_uint32
+gss_krb5_ccache_name(minor_status, name, out_name)
+       OM_uint32 *minor_status;
+       const char *name, const char **out_name;
+{
+       if (GSS_ERROR(kg_get_context(minor_status, &context)))
+               return (GSS_S_FAILURE);
+
+       if (out_name)
+               *out_name = krb5_cc_default_name(context);
+       if (name) {
+               retval = krb5_cc_set_default_name(context, name);
+               if (retval) {
+                       *minor_status = retval;
+                       return GSS_S_FAILURE;
+               }
+       }
+       return GSS_S_SUCCESS;
+}
+               
+
+       
+