summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd_cache.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-04-10 11:53:53 +0200
committerMichael Adam <obnox@samba.org>2008-04-10 13:23:30 +0200
commitb884db5c47a958188d9570f78093b9443b48b9cc (patch)
treef883f3587a57a46916423df6836c407b6168496a /source3/winbindd/winbindd_cache.c
parent0f37cd0c8e62e5bffcbf587c1c826b35802e1e8b (diff)
downloadsamba-b884db5c47a958188d9570f78093b9443b48b9cc.tar.gz
samba-b884db5c47a958188d9570f78093b9443b48b9cc.tar.bz2
samba-b884db5c47a958188d9570f78093b9443b48b9cc.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 (This used to be commit 641b5e3fecfce9581536de8daf6d7e6ecbefaf34)
Diffstat (limited to 'source3/winbindd/winbindd_cache.c')
-rw-r--r--source3/winbindd/winbindd_cache.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index e4b0a53d5d..ddb0ab317e 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -3476,6 +3476,20 @@ int winbindd_validate_cache_nobackup(void)
return ret;
}
+bool winbindd_cache_validate_and_initialize(void)
+{
+ close_winbindd_cache();
+
+ if (lp_winbind_offline_logon()) {
+ if (winbindd_validate_cache() < 0) {
+ DEBUG(0, ("winbindd cache tdb corrupt and no backup "
+ "could be restored.\n"));
+ }
+ }
+
+ return initialize_winbindd_cache();
+}
+
/*********************************************************************
********************************************************************/