Thread-safety for file-based credentials caches
authorKen Raeburn <raeburn@mit.edu>
Wed, 30 Jun 2004 23:24:42 +0000 (23:24 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 30 Jun 2004 23:24:42 +0000 (23:24 +0000)
commit4391b68b20f2e4f16368bd570fe3837f2ff6aecb
tree8944cc64e30c3ac35bf8c528802af8008678b8c9
parentf8d9ab540ba7e5195443ae4987f4e3bfbcfb71ca
Thread-safety for file-based credentials caches

* cc_file.c (krb5_fcc_data): Added a mutex.
(krb5_fcc_read*, krb5_fcc_write, krb5_fcc_store_*, krb5_fcc_open_file,
krb5_fcc_skip_header, krb5_fcc_skip_principal): Verify that the mutex is
locked.
(MAYBE_OPEN): Verify that the mutex is locked; unlock it if returning an error.
(krb5_fcc_initialize, krb5_fcc_start_seq_get, krb5_fcc_get_principal,
krb5_fcc_store, krb5_fcc_set_flags): Lock and unlock the mutex.
(krb5_fcc_close): Likewise.  Destroy the mutex when done.
(krb5_fcc_destroy): Merge stdio and non-stdio versions a little more.  Destroy
the mutex when done.
(krb5_fcc_resolve): Initialize and lock the mutex.
(krb5_fcc_next_cred): Lock and unlock the mutex.  Merge the stdio and non-stdio
branches a little more.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16534 dc483132-0cff-0310-8789-dd5450dbe970
src/lib/krb5/ccache/ChangeLog
src/lib/krb5/ccache/cc_file.c