diff options
author | Michael Adam <obnox@samba.org> | 2008-04-10 11:53:53 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2008-04-10 16:10:28 +0200 |
commit | 9c48ccb25eb7eb564ce18ea1bda51861488a7538 (patch) | |
tree | 64e5e31c1255956247570acb1aea4987a3f06059 /source/winbindd/winbindd.c | |
parent | a5ef5ca119a151022435589ac310a798f71fd379 (diff) | |
download | samba-9c48ccb25eb7eb564ce18ea1bda51861488a7538.tar.gz samba-9c48ccb25eb7eb564ce18ea1bda51861488a7538.tar.xz samba-9c48ccb25eb7eb564ce18ea1bda51861488a7538.zip |
winbindd: only call winbindd_validate_cache when not in offline logon mode.
originally, the cache was cleared before calling validate, but
this way, we skipt the validation of the database when not in
offline logon mode.
This is put into a new wrapper function winbindd_cache_validate_and_initialize()
which is now called in winbindd.c instead calling validate and
initialize functions separately.
Michael
(cherry picked from commit 641b5e3fecfce9581536de8daf6d7e6ecbefaf34)
Diffstat (limited to 'source/winbindd/winbindd.c')
-rw-r--r-- | source/winbindd/winbindd.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/source/winbindd/winbindd.c b/source/winbindd/winbindd.c index 25ceeeb3210..dbfd397f8bc 100644 --- a/source/winbindd/winbindd.c +++ b/source/winbindd/winbindd.c @@ -123,19 +123,7 @@ static void flush_caches(void) if (!wcache_invalidate_cache()) { 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, ("winbindd cache tdb corrupt and no backup " - "could be restore.\n")); - } - - /* Initialize cache again. */ - if (!initialize_winbindd_cache()) { + if (!winbindd_cache_validate_and_initialize()) { exit(1); } } @@ -1194,14 +1182,9 @@ int main(int argc, char **argv, char **envp) /* * Ensure all cache and idmap caches are consistent - * before we startup. + * and initialized before we startup. */ - if (winbindd_validate_cache() < 0) { - DEBUG(0, ("corrupted tdb found, trying to restore backup\n")); - } - - /* Initialize cache (ensure version is correct). */ - if (!initialize_winbindd_cache()) { + if (!winbindd_cache_validate_and_initialize()) { exit(1); } |