summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2006-05-04 12:37:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:16:43 -0500
commita0ff50efa79f08f538f0c341744572929ac5a298 (patch)
tree607c451d8cacff98a67b9b10c93b89db9483f702 /source3/utils
parentd2418fbf276121eae08f05cbf3d6b3c84eb09887 (diff)
downloadsamba-a0ff50efa79f08f538f0c341744572929ac5a298.tar.gz
samba-a0ff50efa79f08f538f0c341744572929ac5a298.tar.bz2
samba-a0ff50efa79f08f538f0c341744572929ac5a298.zip
r15428: Add "smbcontrol winbind onlinestatus" for debugging purpose.
Guenther (This used to be commit 9e15b1659c105b0be846e8f71c27b20eab961bd2)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/smbcontrol.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c
index c368ee0ad4..ad05f8e948 100644
--- a/source3/utils/smbcontrol.c
+++ b/source3/utils/smbcontrol.c
@@ -909,6 +909,36 @@ static BOOL do_winbind_offline(const struct process_id pid,
return ret;
}
+static BOOL do_winbind_onlinestatus(const struct process_id pid,
+ const int argc, const char **argv)
+{
+ struct process_id myid;
+
+ myid = pid_to_procid(sys_getpid());
+
+ if (argc != 1) {
+ fprintf(stderr, "Usage: smbcontrol winbindd onlinestatus\n");
+ return False;
+ }
+
+ message_register(MSG_WINBIND_ONLINESTATUS, print_pid_string_cb);
+
+ if (!send_message(pid, MSG_WINBIND_ONLINESTATUS, &myid, sizeof(myid), False))
+ return False;
+
+ wait_replies(procid_to_pid(&pid) == 0);
+
+ /* No replies were received within the timeout period */
+
+ if (num_replies == 0)
+ printf("No replies received\n");
+
+ message_deregister(MSG_WINBIND_ONLINESTATUS);
+
+ return num_replies;
+}
+
+
static BOOL do_reload_config(const struct process_id pid,
const int argc, const char **argv)
{
@@ -999,6 +1029,7 @@ static const struct {
{ "nodestatus", do_nodestatus, "Ask nmbd to do a node status request"},
{ "online", do_winbind_online, "Ask winbind to go into online state"},
{ "offline", do_winbind_offline, "Ask winbind to go into offline state"},
+ { "onlinestatus", do_winbind_onlinestatus, "Request winbind online status"},
{ "noop", do_noop, "Do nothing" },
{ NULL }
};