summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2006-10-09 15:11:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:21 -0500
commitb405a3971474ac28d3984488395894f540bac4e0 (patch)
tree7b10f72c33fda01e99f847de792a095c8587e606 /source3/utils
parent9d20474a48931a2574e04ba89db730be9bfb7288 (diff)
downloadsamba-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/utils')
-rw-r--r--source3/utils/smbcontrol.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c
index a23492f9dc..9ca304c62b 100644
--- a/source3/utils/smbcontrol.c
+++ b/source3/utils/smbcontrol.c
@@ -882,25 +882,27 @@ static BOOL do_winbind_offline(const struct process_id pid,
5 times. */
for (retry = 0; retry < 5; retry++) {
- int err;
TDB_DATA d;
+ char buf[4];
+
ZERO_STRUCT(d);
+
+ SIVAL(buf, 0, time(NULL));
+ d.dptr = buf;
+ d.dsize = 4;
+
tdb_store_bystring(tdb, "WINBINDD_OFFLINE", d, TDB_INSERT);
ret = send_message(pid, MSG_WINBIND_OFFLINE, NULL, 0, False);
/* Check that the entry "WINBINDD_OFFLINE" still exists. */
- /* tdb->ecode = TDB_SUCCESS; */
d = tdb_fetch_bystring( 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(tdb);
-
- if (err == TDB_ERR_NOEXIST) {
+
+ if (!d.dptr || d.dsize != 4) {
+ SAFE_FREE(d.dptr);
DEBUG(10,("do_winbind_offline: offline state not set - retrying.\n"));
} else {
+ SAFE_FREE(d.dptr);
break;
}
}