X-Git-Url: http://git.samba.org/samba.git/?p=ira%2Fwip.git;a=blobdiff_plain;f=source%2Fwinbindd%2Fwinbindd.c;h=dfad50bf964ba9a33f6ef37a6378494c7bcd369c;hp=07cf22618e4a37b678876857363e176c103a4cb3;hb=d0c0f91fb9f3438a18c6f47ed894f525beb75cbf;hpb=d9d6775878f8b3425665c6a45a5ef9cb92932cf8 diff --git a/source/winbindd/winbindd.c b/source/winbindd/winbindd.c index 07cf22618e4..dfad50bf964 100644 --- a/source/winbindd/winbindd.c +++ b/source/winbindd/winbindd.c @@ -121,7 +121,23 @@ static void flush_caches(void) otherwise cached access denied errors due to restrict anonymous hang around until the sequence number changes. */ - wcache_invalidate_cache(); + if (wcache_invalidate_cache() < 0) { + DEBUG(0, ("invalidating the cache failed; revalidate the cache\n")); + /* Close the cache to be able to valdite the cache */ + close_winbindd_cache(); + /* + * Ensure all cache and idmap caches are consistent + * before we initialize the cache again. + */ + if (winbindd_validate_cache() < 0) { + DEBUG(0, ("corrupted tdb found, trying to restore backup\n")); + } + + /* Initialize cache again. */ + if (!initialize_winbindd_cache()) { + exit(1); + } + } } /* Handle the signal by unlinking socket and exiting */