summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2006-07-11 09:22:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:19:12 -0500
commit44f2d54db2cad7b64d87090838d4adc472838147 (patch)
treeb6ba22469193c7803e1cc522661698719370efef /source3/nsswitch
parent5d80b1dcd53bd0771e13f7241ab0fad238304c5b (diff)
downloadsamba-44f2d54db2cad7b64d87090838d4adc472838147.tar.gz
samba-44f2d54db2cad7b64d87090838d4adc472838147.tar.bz2
samba-44f2d54db2cad7b64d87090838d4adc472838147.zip
r16939: Still clear the winbind_cache.tdb when offline logons are not enabled.
Guenther (This used to be commit 4121ccfc3e39001d5b7b8288e3bc27d919f79167)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/winbindd_cache.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/nsswitch/winbindd_cache.c b/source3/nsswitch/winbindd_cache.c
index 5cbaa77805..b267a3f770 100644
--- a/source3/nsswitch/winbindd_cache.c
+++ b/source3/nsswitch/winbindd_cache.c
@@ -1891,7 +1891,8 @@ static BOOL init_wcache(void)
/* when working offline we must not clear the cache on restart */
wcache->tdb = tdb_open_log(lock_path("winbindd_cache.tdb"),
WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE,
- TDB_DEFAULT /*TDB_CLEAR_IF_FIRST*/, O_RDWR|O_CREAT, 0600);
+ lp_winbind_offline_logon() ? TDB_DEFAULT : (TDB_DEFAULT | TDB_CLEAR_IF_FIRST),
+ O_RDWR|O_CREAT, 0600);
if (wcache->tdb == NULL) {
DEBUG(0,("Failed to open winbindd_cache.tdb!\n"));
@@ -2133,7 +2134,8 @@ void wcache_flush_cache(void)
/* when working offline we must not clear the cache on restart */
wcache->tdb = tdb_open_log(lock_path("winbindd_cache.tdb"),
WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE,
- TDB_DEFAULT /* TDB_CLEAR_IF_FIRST */, O_RDWR|O_CREAT, 0600);
+ lp_winbind_offline_logon() ? TDB_DEFAULT : (TDB_DEFAULT | TDB_CLEAR_IF_FIRST),
+ O_RDWR|O_CREAT, 0600);
if (!wcache->tdb) {
DEBUG(0,("Failed to open winbindd_cache.tdb!\n"));