krb5/krb5 — pull request #218 by greghudson (2014-10-13 21:25:58+00:00)
Title: Redesign FILE ccache I/O handling

These four commits implement a new design for FILE ccache I/O, based partly on past discussions with Nico. Benefits of the new design include:

* About a 30% reduction in lines of code.
* Callers don't have to mess around with flags when iterating over a cache.
* RT issue #7804 is fixed; one thread iterating over a ccache will not cause another thread's store operation to fail.
* If a cache file is replaced (by kinit or whatever), iterators will always continue iterating over the old cache, and will never try to open and seek into the new one.
* If OFD locks are unavailable on the platform and regular POSIX locks are prematurely removed due to their poor semantics, the use of O_APPEND writes should almost always avoid corruption and race issues.