Module Name: krb5 Committed By: raeburn Date: Fri Aug 13 04:02:36 UTC 2004 Modified Files: krb5/src/lib/krb5/ccache/ChangeLog krb5/src/lib/krb5/ccache/cc-int.h krb5/src/lib/krb5/ccache/cc_file.c krb5/src/lib/krb5/ccache/ccbase.c Added Files: Removed Files: Log Message Only open a credential cache file once, even if multiple krb5_ccache objects refer to it. (This does NOT yet take care of the problem of multiple threads wanting to use OS-level advisory locks, which at least on UNIX are per-process and not per-thread.) * cc_file.c (krb5_fcc_close_file): Change first argument to be an fcc-data pointer, not a krb5_ccache. All calls changed. (struct fcc_set): Add a refcount member. (Definition accidentally introduced without comment in an earlier patch.) (krb5int_cc_file_mutex, fccs): New variables, for managing a global list of open credential cache files. (dereference): New function, with most of old close/destroy operations. Decrements reference count and only frees the object and removes it from the global list if the refcount hits zero. (krb5_fcc_close, krb5_fcc_destroy): Call dereference. (krb5_fcc_resolve): If a file cache is already open with the same file name, increment its reference count and don't create a new one. When a new one is created, add it to the global list. * cc-int.h (krb5int_cc_file_mutex): Declare. * ccbase.c (krb5int_cc_initialize): Initialize it. (krb5int_cc_finalize): Destroy it, and krb5int_mcc_mutex. To generate a diff of this commit: cvs diff -r5.136 -r5.137 krb5/src/lib/krb5/ccache/ChangeLog cvs diff -r5.3 -r5.4 krb5/src/lib/krb5/ccache/cc-int.h cvs diff -r5.37 -r5.38 krb5/src/lib/krb5/ccache/cc_file.c cvs diff -r5.29 -r5.30 krb5/src/lib/krb5/ccache/ccbase.c