diff options
Diffstat (limited to 'source3/rpcclient/cmd_reg.c')
-rw-r--r-- | source3/rpcclient/cmd_reg.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/source3/rpcclient/cmd_reg.c b/source3/rpcclient/cmd_reg.c index 5d29b4c51a..e0a3201aa9 100644 --- a/source3/rpcclient/cmd_reg.c +++ b/source3/rpcclient/cmd_reg.c @@ -900,8 +900,7 @@ static NTSTATUS cmd_reg_shutdown(struct cli_state *cli, TALLOC_CTX *mem_ctx, NTSTATUS result = NT_STATUS_UNSUCCESSFUL; fstring msg; uint32 timeout = 20; - BOOL force = False; - BOOL reboot = False; + uint16 flgs = 0; int opt; *msg = 0; @@ -909,33 +908,37 @@ 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': - reboot = True; - break; - + { + flgs |= 0x100; + break; + } case 'f': - force = True; + { + flgs |= 0x001; break; - + } } } /* create an entry */ - result = cli_reg_shutdown(cli, mem_ctx, msg, timeout, reboot, force); + result = cli_reg_shutdown(cli, mem_ctx, msg, timeout, flgs); if (NT_STATUS_IS_OK(result)) DEBUG(5,("cmd_reg_shutdown: query succeeded\n")); @@ -971,10 +974,10 @@ struct cmd_set reg_commands[] = { { "REG" }, { "shutdown", cmd_reg_shutdown, PI_WINREG, "Remote Shutdown", - "syntax: shutdown [-m message] [-t timeout] [-r] [-h] [-f] (-r == reboot, -h == halt, -f == force)" }, + "[-m message] [-t timeout] [-r] [-f] (-r == reboot, -f == force)" }, { "abortshutdown", cmd_reg_abort_shutdown, PI_WINREG, "Abort Shutdown", - "syntax: abortshutdown" }, + "" }, /* { "regenum", cmd_reg_enum, "Registry Enumeration", "<keyname>" }, |