+ 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);
+ }
+ }