summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2002-12-30 04:41:27 +0000
committerSimo Sorce <idra@samba.org>2002-12-30 04:41:27 +0000
commit60667264b71d624ec45f567170b85589992567ed (patch)
treec9ccce0ff9c95e8ae9f3059408915eb37b6c73f4 /source3/rpcclient
parentb68e6c99103fd0f1e8a25b2fafe14d7540b2ab10 (diff)
downloadsamba-60667264b71d624ec45f567170b85589992567ed.tar.gz
samba-60667264b71d624ec45f567170b85589992567ed.tar.bz2
samba-60667264b71d624ec45f567170b85589992567ed.zip
the shutdown call does not have a 16 bit flags, but 2 byte representing booleans
this commit change the structure and code to reflect this some test revelead I'm right. some other revelead currently the abort shutdown does not work against my test machine even if it returns successfully ... need investigation (This used to be commit c5892b656dedd0367adc33d9606311d1dde99a58)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_reg.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/source3/rpcclient/cmd_reg.c b/source3/rpcclient/cmd_reg.c
index e0a3201aa9..5d29b4c51a 100644
--- a/source3/rpcclient/cmd_reg.c
+++ b/source3/rpcclient/cmd_reg.c
@@ -900,7 +900,8 @@ static NTSTATUS cmd_reg_shutdown(struct cli_state *cli, TALLOC_CTX *mem_ctx,
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
fstring msg;
uint32 timeout = 20;
- uint16 flgs = 0;
+ BOOL force = False;
+ BOOL reboot = False;
int opt;
*msg = 0;
@@ -908,37 +909,33 @@ static NTSTATUS cmd_reg_shutdown(struct cli_state *cli, TALLOC_CTX *mem_ctx,
while ((opt = getopt(argc, argv, "m:t:rf")) != EOF)
{
- fprintf (stderr, "[%s]\n", argv[argc-1]);
+ /*fprintf (stderr, "[%s]\n", argv[argc-1]);*/
switch (opt)
{
case 'm':
- {
safe_strcpy(msg, optarg, sizeof(msg)-1);
- fprintf (stderr, "[%s|%s]\n", optarg, msg);
+ /*fprintf (stderr, "[%s|%s]\n", optarg, msg);*/
break;
- }
+
case 't':
- {
timeout = atoi(optarg);
- fprintf (stderr, "[%s|%d]\n", optarg, timeout);
- break;
- }
+ /*fprintf (stderr, "[%s|%d]\n", optarg, timeout);*/
+ break;
+
case 'r':
- {
- flgs |= 0x100;
- break;
- }
+ reboot = True;
+ break;
+
case 'f':
- {
- flgs |= 0x001;
+ force = True;
break;
- }
+
}
}
/* create an entry */
- result = cli_reg_shutdown(cli, mem_ctx, msg, timeout, flgs);
+ result = cli_reg_shutdown(cli, mem_ctx, msg, timeout, reboot, force);
if (NT_STATUS_IS_OK(result))
DEBUG(5,("cmd_reg_shutdown: query succeeded\n"));
@@ -974,10 +971,10 @@ struct cmd_set reg_commands[] = {
{ "REG" },
{ "shutdown", cmd_reg_shutdown, PI_WINREG, "Remote Shutdown",
- "[-m message] [-t timeout] [-r] [-f] (-r == reboot, -f == force)" },
+ "syntax: shutdown [-m message] [-t timeout] [-r] [-h] [-f] (-r == reboot, -h == halt, -f == force)" },
{ "abortshutdown", cmd_reg_abort_shutdown, PI_WINREG, "Abort Shutdown",
- "" },
+ "syntax: abortshutdown" },
/*
{ "regenum", cmd_reg_enum, "Registry Enumeration",
"<keyname>" },