From 57ac659fb6875be42c306f63984c5b9c8073c878 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 31 Aug 2007 16:30:40 +0000 Subject: r24848: Make tdb_validate() take an open tdb handle instead of a file name. A new wrapper tdb_validate_open() takes a filename an opens and closes the tdb before and after calling tdb_validate() respectively. winbindd_validata_cache_nobackup() now dynamically calls one of the above functions depending on whether the cache tdb has already been opened or not. Michael (This used to be commit dc0b08e6590caa4974fd4d9f34f39f261d1f1dee) --- source3/nsswitch/winbindd_cache.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/nsswitch') diff --git a/source3/nsswitch/winbindd_cache.c b/source3/nsswitch/winbindd_cache.c index 6925a082ee..65279497e4 100644 --- a/source3/nsswitch/winbindd_cache.c +++ b/source3/nsswitch/winbindd_cache.c @@ -3329,7 +3329,12 @@ int winbindd_validate_cache_nobackup(void) DEBUG(10, ("winbindd_validate_cache: replacing panic function\n")); smb_panic_fn = validate_panic; - ret = tdb_validate(tdb_path, cache_traverse_validate_fn); + + if (wcache == NULL || wcache->tdb == NULL) { + ret = tdb_validate_open(tdb_path, cache_traverse_validate_fn); + } else { + ret = tdb_validate(wcache->tdb, cache_traverse_validate_fn); + } if (ret != 0) { DEBUG(10, ("winbindd_validate_cache_nobackup: validation not " -- cgit