Пример #1
0
static cc_int32
ccache_set_default(cc_ccache_t io_ccache)
{
    struct cc_ccache *c = (struct cc_ccache *)io_ccache;
    LOG_ENTRY();
    if (io_ccache == NULL || c->id == NULL)
	return ccErrBadParam;
    heim_krb5_cc_switch(milcontext, c->id);
    update_time(&c->change_time);
    update_time(&c->last_default_time);
    return ccNoError;
}
Пример #2
0
KLStatus
KLSetSystemDefaultCache (KLPrincipal inPrincipal)
{
    krb5_context context = mshim_ctx();
    krb5_error_code ret;
    krb5_ccache id;

    LOG_ENTRY();

    ret = heim_krb5_cc_cache_match(context, inPrincipal, &id);
    if (ret)
	return LOG_FAILURE(ret, "ccache match");
    ret = heim_krb5_cc_switch(context, id);
    heim_krb5_cc_close(context, id);
    if (ret)
	return LOG_FAILURE(ret, "cc switch");
    return klNoErr;
}