first implementation of kcm-move-cache

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22777 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2008-03-25 12:20:55 +00:00
parent d21ed38e71
commit a760147457
3 changed files with 108 additions and 4 deletions

View File

@@ -832,8 +832,31 @@ kcm_get_version(krb5_context context,
static krb5_error_code
kcm_move(krb5_context context, krb5_ccache from, krb5_ccache to)
{
krb5_set_error_string(context, "kcm_move not implemented");
return EINVAL;
krb5_error_code ret;
krb5_kcmcache *oldk = KCMCACHE(from);
krb5_kcmcache *newk = KCMCACHE(to);
krb5_storage *request;
ret = kcm_storage_request(context, KCM_OP_MOVE_CACHE, &request);
if (ret)
return ret;
ret = krb5_store_stringz(request, oldk->name);
if (ret) {
krb5_storage_free(request);
return ret;
}
ret = krb5_store_stringz(request, newk->name);
if (ret) {
krb5_storage_free(request);
return ret;
}
ret = kcm_call(context, k, request, NULL, NULL);
krb5_storage_free(request);
return ret;
}
static krb5_error_code
@@ -1118,5 +1141,4 @@ _krb5_kcm_get_ticket(krb5_context context,
return ret;
}
#endif /* HAVE_KCM */

View File

@@ -59,6 +59,7 @@ typedef enum kcm_operation {
KCM_OP_CHMOD,
KCM_OP_GET_INITIAL_TICKET,
KCM_OP_GET_TICKET,
KCM_OP_MOVE_CACHE,
KCM_OP_MAX
} kcm_operation;