diff options
author | Günther Deschner <gd@samba.org> | 2006-10-09 15:11:37 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:15:21 -0500 |
commit | b405a3971474ac28d3984488395894f540bac4e0 (patch) | |
tree | 7b10f72c33fda01e99f847de792a095c8587e606 /source3/nsswitch/winbindd_cache.c | |
parent | 9d20474a48931a2574e04ba89db730be9bfb7288 (diff) | |
download | samba-b405a3971474ac28d3984488395894f540bac4e0.tar.gz samba-b405a3971474ac28d3984488395894f540bac4e0.tar.bz2 samba-b405a3971474ac28d3984488395894f540bac4e0.zip |
r19206: Jeremy, for some reason storing a value-less entry in TDB does not work
anymore in 3_0. I'm just adding a time(NULL) as value for the
WINBINDD_OFFLINE key.
Guenther
(This used to be commit 2bdf9f140f76d6eb73b34148c47f7d3447e2e563)
Diffstat (limited to 'source3/nsswitch/winbindd_cache.c')
-rw-r--r-- | source3/nsswitch/winbindd_cache.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/source3/nsswitch/winbindd_cache.c b/source3/nsswitch/winbindd_cache.c index 745a9e262a..4eece858e1 100644 --- a/source3/nsswitch/winbindd_cache.c +++ b/source3/nsswitch/winbindd_cache.c @@ -2523,7 +2523,6 @@ done: BOOL set_global_winbindd_state_offline(void) { TDB_DATA data; - int err; DEBUG(10,("set_global_winbindd_state_offline: offline requested.\n")); @@ -2545,21 +2544,16 @@ BOOL set_global_winbindd_state_offline(void) return True; } -/* wcache->tdb->ecode = 0; */ - data = tdb_fetch_bystring( wcache->tdb, "WINBINDD_OFFLINE" ); - /* As this is a key with no data we don't need to free, we - check for existence by looking at tdb_err. */ - - err = tdb_error(wcache->tdb); - - if (err == TDB_ERR_NOEXIST) { + if (!data.dptr || data.dsize != 4) { DEBUG(10,("set_global_winbindd_state_offline: offline state not set.\n")); + SAFE_FREE(data.dptr); return False; } else { DEBUG(10,("set_global_winbindd_state_offline: offline state set.\n")); global_winbindd_offline_state = True; + SAFE_FREE(data.dptr); return True; } } |