summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2010-04-08 16:39:31 +0000
committerGreg Hudson <ghudson@mit.edu>2010-04-08 16:39:31 +0000
commit51d539646c4ebd71934ae7a924dfa07a668c8384 (patch)
tree3aa1b1fc88778496902c22add3fa9cdef3b40bf2 /src
parent3f34bcb50b8e2a3af2cd9ed6acec36c3aa1d4712 (diff)
downloadkrb5-51d539646c4ebd71934ae7a924dfa07a668c8384.tar.gz
krb5-51d539646c4ebd71934ae7a924dfa07a668c8384.tar.xz
krb5-51d539646c4ebd71934ae7a924dfa07a668c8384.zip
Add krb5_cc_dup() to make it possible to copy ccache handles
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23874 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/include/krb5/krb5.hin7
-rw-r--r--src/lib/krb5/ccache/ccbase.c6
2 files changed, 13 insertions, 0 deletions
diff --git a/src/include/krb5/krb5.hin b/src/include/krb5/krb5.hin
index d9f3ba8640..740390c9af 100644
--- a/src/include/krb5/krb5.hin
+++ b/src/include/krb5/krb5.hin
@@ -1850,6 +1850,13 @@ krb5_principal2salt(krb5_context, krb5_const_principal, krb5_data *);
krb5_error_code KRB5_CALLCONV
krb5_cc_resolve(krb5_context, const char *, krb5_ccache *);
+/**
+ * Create a new handle referring to the same cache as @a in.
+ * The new handle and @a in can be closed independently.
+ */
+krb5_error_code KRB5_CALLCONV
+krb5_cc_dup(krb5_context context, krb5_ccache in, krb5_ccache *out);
+
const char *KRB5_CALLCONV
krb5_cc_default_name(krb5_context);
diff --git a/src/lib/krb5/ccache/ccbase.c b/src/lib/krb5/ccache/ccbase.c
index 2e40b48f32..023c7b158f 100644
--- a/src/lib/krb5/ccache/ccbase.c
+++ b/src/lib/krb5/ccache/ccbase.c
@@ -238,6 +238,12 @@ krb5_cc_resolve (krb5_context context, const char *name, krb5_ccache *cache)
return ops->resolve(context, cache, resid);
}
+krb5_error_code KRB5_CALLCONV
+krb5_cc_dup(krb5_context context, krb5_ccache in, krb5_ccache *out)
+{
+ return in->ops->resolve(context, out, in->ops->get_name(context, in));
+}
+
/*
* cc_getops
*