Add krb5_cc_dup() to make it possible to copy ccache handles
authorGreg Hudson <ghudson@mit.edu>
Thu, 8 Apr 2010 16:39:31 +0000 (16:39 +0000)
committerGreg Hudson <ghudson@mit.edu>
Thu, 8 Apr 2010 16:39:31 +0000 (16:39 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23874 dc483132-0cff-0310-8789-dd5450dbe970

src/include/krb5/krb5.hin
src/lib/krb5/ccache/ccbase.c

index d9f3ba86409970df8570d1784960fabe7e0c5d11..740390c9af2174fc3dbf64e43d921c7bcb66c671 100644 (file)
@@ -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);
 
index 2e40b48f32de26c948403d965bc7d7447a2b82bf..023c7b158f434595306ee423c679ab8e15e7643c 100644 (file)
@@ -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
  *