gencache: don't use CLEAR_IF_FIRST as fallback.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 19 Apr 2011 02:36:05 +0000 (12:06 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 19 Apr 2011 02:36:05 +0000 (12:06 +0930)
commit7deeacae2bab03d5e2ea2642f028a4011ce3bec3
treefc251e9d3047c390342a5cff3931fe32b9374830
parent3ccfe7cb7be80cc6fa5b8fc437af72168515b892
gencache: don't use CLEAR_IF_FIRST as fallback.

CLEAR_IF_FIRST only works if *all* openers use that flag.

So just truncate the file: it's racy, but that's what we're doing anyway.

We'd really need a TDB_OPENCHECK_OR_CLEAR flag to do this properly (or in
TDB2, a open hook at the right point).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
source3/lib/gencache.c
source3/libsmb/samlogon_cache.c