From a4c92698c652328d04206ab3b4aeabda9e5c2943 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 31 Aug 2007 10:47:42 +0000 Subject: r24830: Add a winbindd cache validation function that does not do backup and corrupt file handling. (To be used in subsequent changes.) (This used to be commit b3dcadbed0b4a1b7bb2e83df2c66bca9dcbcad60) --- source3/nsswitch/winbindd_cache.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'source3') diff --git a/source3/nsswitch/winbindd_cache.c b/source3/nsswitch/winbindd_cache.c index eb79e281cd..6925a082ee 100644 --- a/source3/nsswitch/winbindd_cache.c +++ b/source3/nsswitch/winbindd_cache.c @@ -3317,6 +3317,31 @@ done: return ret; } +/*********************************************************************** + Try and validate every entry in the winbindd cache. +***********************************************************************/ + +int winbindd_validate_cache_nobackup(void) +{ + int ret = -1; + const char *tdb_path = lock_path("winbindd_cache.tdb"); + + DEBUG(10, ("winbindd_validate_cache: replacing panic function\n")); + smb_panic_fn = validate_panic; + + ret = tdb_validate(tdb_path, cache_traverse_validate_fn); + + if (ret != 0) { + DEBUG(10, ("winbindd_validate_cache_nobackup: validation not " + "successful.\n")); + } + + DEBUG(10, ("winbindd_validate_cache_nobackup: restoring panic " + "function\n")); + smb_panic_fn = smb_panic; + return ret; +} + /********************************************************************* ********************************************************************/ -- cgit