diff options
author | Michael Adam <obnox@samba.org> | 2007-08-31 16:30:40 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:30:27 -0500 |
commit | 57ac659fb6875be42c306f63984c5b9c8073c878 (patch) | |
tree | fe5c9b561befd4559e381a75a4bba66602f82dd3 /source3/nsswitch | |
parent | f02f8563a20c8a676e81f61cf74fa3b20db000f0 (diff) | |
download | samba-57ac659fb6875be42c306f63984c5b9c8073c878.tar.gz samba-57ac659fb6875be42c306f63984c5b9c8073c878.tar.bz2 samba-57ac659fb6875be42c306f63984c5b9c8073c878.zip |
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)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r-- | source3/nsswitch/winbindd_cache.c | 7 |
1 files changed, 6 insertions, 1 deletions
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 " |