FILE ccache corruption, possible fix

Nico Williams nico at
Wed Jan 22 01:34:35 EST 2014

On Wednesday, January 22, 2014, Nico Williams <nico at> wrote:

> Oh, of course, readers must delay closing the fildes, or perhaps acquire a
> [whole file] write lock immediately before closing the fildes (to make sure
> not to be stepping on any writer's toes.

If we stop the whole open/close business and stat instead to decide when to
reopen the file ccache and then always acquire a write lock before closing
the thing, then that won't suck too much.  Also, caching the open ccache
fildes in the krb5_context would mean deferring the need to acquire a write
lock to ccache reopen times or context free times, so as to not force
serialization of all reads (though at the limit that's what acquiring a
write lock before closing means).

More information about the krbdev mailing list