diff options
| author | Justin Anderson <jander@mit.edu> | 2008-09-22 17:03:51 +0000 |
|---|---|---|
| committer | Justin Anderson <jander@mit.edu> | 2008-09-22 17:03:51 +0000 |
| commit | 6e83d0bd31721ac86003530dd2450221dd05d0c2 (patch) | |
| tree | 25c9defac58c7c982c3e7cad5b7847b530430191 /src/include | |
| parent | 85f452a27b855c2fb456e2c6d8c73a5c1f037841 (diff) | |
| download | krb5-6e83d0bd31721ac86003530dd2450221dd05d0c2.tar.gz krb5-6e83d0bd31721ac86003530dd2450221dd05d0c2.tar.xz krb5-6e83d0bd31721ac86003530dd2450221dd05d0c2.zip | |
Merge 1.7 work on auxiliary ccache functions necessary for KIM. Adds krb5_cc_lock/unlock, krb5_cccol_lock/unlock, krb5_cc_last_change_time, krb5_cccol_last_change_time, krb5_cc_move, and adds pertype cursor support to some cache types
Locking functions work the same as the CCAPI cc_ccache_lock / cc_context_lock functions, though not as read/write locks.
ticket: 6124
status: open
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20743 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/k5-int.h | 36 | ||||
| -rw-r--r-- | src/include/krb5/krb5.hin | 25 |
2 files changed, 60 insertions, 1 deletions
diff --git a/src/include/k5-int.h b/src/include/k5-int.h index 545bd983a..111b12159 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -2027,11 +2027,14 @@ struct _krb5_cc_ops { krb5_ccache *); krb5_error_code (KRB5_CALLCONV *ptcursor_free)(krb5_context, krb5_cc_ptcursor *); - krb5_error_code (KRB5_CALLCONV *move)(krb5_context, krb5_ccache); + krb5_error_code (KRB5_CALLCONV *move)(krb5_context, krb5_ccache, + krb5_ccache); krb5_error_code (KRB5_CALLCONV *lastchange)(krb5_context, krb5_ccache, krb5_timestamp *); krb5_error_code (KRB5_CALLCONV *wasdefault)(krb5_context, krb5_ccache, krb5_timestamp *); + krb5_error_code (KRB5_CALLCONV *lock)(krb5_context, krb5_ccache); + krb5_error_code (KRB5_CALLCONV *unlock)(krb5_context, krb5_ccache); }; extern const krb5_cc_ops *krb5_cc_dfl_ops; @@ -2039,6 +2042,37 @@ extern const krb5_cc_ops *krb5_cc_dfl_ops; krb5_error_code krb5int_cc_os_default_name(krb5_context context, char **name); +/* reentrant mutex used by krb5_cc_* functions */ +typedef struct _k5_cc_mutex { + k5_mutex_t lock; + krb5_context owner; + krb5_int32 refcount; +} k5_cc_mutex; + +#define K5_CC_MUTEX_PARTIAL_INITIALIZER \ + { K5_MUTEX_PARTIAL_INITIALIZER, NULL, 0 } + +krb5_error_code +k5_cc_mutex_init(k5_cc_mutex *m); + +krb5_error_code +k5_cc_mutex_finish_init(k5_cc_mutex *m); + +#define k5_cc_mutex_destroy(M) \ +k5_mutex_destroy(&(M)->lock); + +void +k5_cc_mutex_assert_locked(krb5_context context, k5_cc_mutex *m); + +void +k5_cc_mutex_assert_unlocked(krb5_context context, k5_cc_mutex *m); + +krb5_error_code +k5_cc_mutex_lock(krb5_context context, k5_cc_mutex *m); + +krb5_error_code +k5_cc_mutex_unlock(krb5_context context, k5_cc_mutex *m); + typedef struct _krb5_donot_replay { krb5_magic magic; krb5_ui_4 hash; diff --git a/src/include/krb5/krb5.hin b/src/include/krb5/krb5.hin index 403bb9f66..82e52ab52 100644 --- a/src/include/krb5/krb5.hin +++ b/src/include/krb5/krb5.hin @@ -1297,6 +1297,22 @@ const char * KRB5_CALLCONV krb5_cc_get_type (krb5_context context, krb5_ccache cache); krb5_error_code KRB5_CALLCONV +krb5_cc_move (krb5_context context, krb5_ccache src, krb5_ccache dst); + +krb5_error_code KRB5_CALLCONV +krb5_cc_last_change_time ( + krb5_context context, + krb5_ccache ccache, + krb5_timestamp *change_time); + +krb5_error_code KRB5_CALLCONV +krb5_cc_lock (krb5_context context, krb5_ccache ccache); + +krb5_error_code KRB5_CALLCONV +krb5_cc_unlock (krb5_context context, krb5_ccache ccache); + + +krb5_error_code KRB5_CALLCONV krb5_cccol_cursor_new(krb5_context context, krb5_cccol_cursor *cursor); krb5_error_code KRB5_CALLCONV @@ -1309,6 +1325,15 @@ krb5_error_code KRB5_CALLCONV krb5_cccol_cursor_free(krb5_context context, krb5_cccol_cursor *cursor); krb5_error_code KRB5_CALLCONV +krb5_cccol_last_change_time(krb5_context context, krb5_timestamp *change_time); + +krb5_error_code KRB5_CALLCONV +krb5_cccol_lock(krb5_context context); + +krb5_error_code KRB5_CALLCONV +krb5_cccol_unlock(krb5_context context); + +krb5_error_code KRB5_CALLCONV krb5_cc_new_unique( krb5_context context, const char *type, |
