add lastmodified
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23923 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -45,6 +45,7 @@ typedef struct krb5_mcache {
|
||||
struct link *next;
|
||||
} *creds;
|
||||
struct krb5_mcache *next;
|
||||
time_t mtime;
|
||||
} krb5_mcache;
|
||||
|
||||
static HEIMDAL_MUTEX mcc_mutex = HEIMDAL_MUTEX_INITIALIZER;
|
||||
@@ -93,6 +94,7 @@ mcc_alloc(const char *name)
|
||||
m->refcnt = 1;
|
||||
m->primary_principal = NULL;
|
||||
m->creds = NULL;
|
||||
m->mtime = time(NULL);
|
||||
m->next = mcc_head;
|
||||
mcc_head = m;
|
||||
HEIMDAL_MUTEX_unlock(&mcc_mutex);
|
||||
@@ -157,6 +159,7 @@ mcc_initialize(krb5_context context,
|
||||
{
|
||||
krb5_mcache *m = MCACHE(id);
|
||||
m->dead = 0;
|
||||
m->mtime = time(NULL);
|
||||
return krb5_copy_principal (context,
|
||||
primary_principal,
|
||||
&m->primary_principal);
|
||||
@@ -252,6 +255,7 @@ mcc_store_cred(krb5_context context,
|
||||
free (l);
|
||||
return ret;
|
||||
}
|
||||
m->mtime = time(NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -326,6 +330,7 @@ mcc_remove_cred(krb5_context context,
|
||||
*q = p->next;
|
||||
krb5_free_cred_contents(context, &p->cred);
|
||||
free(p);
|
||||
m->mtime = time(NULL);
|
||||
} else
|
||||
q = &p->next;
|
||||
}
|
||||
@@ -432,6 +437,8 @@ mcc_move(krb5_context context, krb5_ccache from, krb5_ccache to)
|
||||
mto->primary_principal = mfrom->primary_principal;
|
||||
mfrom->primary_principal = principal;
|
||||
|
||||
mto->mtime = mfrom->mtime = time(NULL);
|
||||
|
||||
HEIMDAL_MUTEX_unlock(&mcc_mutex);
|
||||
mcc_destroy(context, from);
|
||||
|
||||
@@ -450,6 +457,13 @@ mcc_default_name(krb5_context context, char **str)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static krb5_error_code
|
||||
mcc_lastchange(krb5_context context, krb5_ccache id, krb5_timestamp *mtime)
|
||||
{
|
||||
*mtime = MCACHE(id)->mtime;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Variable containing the MEMORY based credential cache implemention.
|
||||
@@ -479,5 +493,7 @@ KRB5_LIB_VARIABLE const krb5_cc_ops krb5_mcc_ops = {
|
||||
mcc_get_cache_next,
|
||||
mcc_end_cache_get,
|
||||
mcc_move,
|
||||
mcc_default_name
|
||||
mcc_default_name,
|
||||
NULL,
|
||||
mcc_lastchange
|
||||
};
|
||||
|
Reference in New Issue
Block a user