summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLove Hörnquist Åstrand <lha@kth.se>2008-11-02 07:04:57 +0000
committerLove Hörnquist Åstrand <lha@kth.se>2008-11-02 07:04:57 +0000
commit86f16fb48de4982528687e39ec65275d6eef707e (patch)
tree5bea699709f19db327101a4c7838647c00934976
parentc0b677504f1dfc4b94021dac42de235d59867747 (diff)
add kcm_ccache_find_cred_uuid
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24001 ec53bebd-3082-4978-b11e-865c3cabbd6b
-rw-r--r--kcm/cache.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/kcm/cache.c b/kcm/cache.c
index 92388d29f..01c20ab5a 100644
--- a/kcm/cache.c
+++ b/kcm/cache.c
@@ -498,6 +498,22 @@ kcm_ccache_store_cred(krb5_context context,
return ret;
}
+struct kcm_creds *
+kcm_ccache_find_cred_uuid(krb5_context context,
+ kcm_ccache ccache,
+ uuid_t uuid)
+{
+ struct kcm_creds *c;
+
+ for (c = ccache->creds; c != NULL; c = c->next)
+ if (uuid_compare(c->uuid, uuid) == 0)
+ return c;
+
+ return NULL;
+}
+
+
+
krb5_error_code
kcm_ccache_store_cred_internal(krb5_context context,
kcm_ccache ccache,
@@ -516,6 +532,8 @@ kcm_ccache_store_cred_internal(krb5_context context,
return KRB5_CC_NOMEM;
}
+ uuid_generate((*c)->uuid);
+
*credp = &(*c)->cred;
if (copy) {
@@ -549,7 +567,6 @@ kcm_ccache_remove_cred_internal(krb5_context context,
if (krb5_compare_creds(context, whichfields, mcreds, &(*c)->cred)) {
struct kcm_creds *cred = *c;
- kcm_cursor_update(context, ccache, cred);
*c = cred->next;
krb5_free_cred_contents(context, &cred->cred);
free(cred);