summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_reg.c35
-rw-r--r--source3/rpcclient/cmd_samr.c2
-rw-r--r--source3/rpcclient/cmd_spoolss.c12
-rw-r--r--source3/rpcclient/rpcclient.h6
4 files changed, 29 insertions, 26 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>" },
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index fbc4d49819..5c6308d07c 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -94,7 +94,7 @@ static void display_sam_user_info_21(SAM_USER_INFO_21 *usr)
}
}
-static const char *display_time(NTTIME nttime)
+static char *display_time(NTTIME nttime)
{
static fstring string;
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index 06da00748b..c76e84580d 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -26,12 +26,12 @@
#include "rpcclient.h"
struct table_node {
- const char *long_archi;
- const char *short_archi;
+ char *long_archi;
+ char *short_archi;
int version;
};
-static const struct table_node archi_table[]= {
+struct table_node archi_table[]= {
{"Windows 4.0", "WIN40", 0 },
{"Windows NT x86", "W32X86", 2 },
@@ -45,7 +45,7 @@ static const struct table_node archi_table[]= {
function to do the mapping between the long architecture name and
the short one.
****************************************************************************/
-BOOL get_short_archi(char *short_archi, const char *long_archi)
+BOOL get_short_archi(char *short_archi, char *long_archi)
{
int i=-1;
@@ -1153,7 +1153,7 @@ void set_drv_info_3_env (DRIVER_INFO_3 *info, const char *arch)
wrapper for strtok to get the next parameter from a delimited list.
Needed to handle the empty parameter string denoted by "NULL"
*************************************************************************/
-static char* get_driver_3_param (char* str, const char* delim, UNISTR* dest)
+static char* get_driver_3_param (char* str, char* delim, UNISTR* dest)
{
char *ptr;
@@ -2135,7 +2135,7 @@ static NTSTATUS cmd_spoolss_enum_printerkey( struct cli_state *cli,
BOOL got_hnd = False;
pstring printername;
fstring servername, user;
- const char *keyname = NULL;
+ char *keyname = NULL;
POLICY_HND hnd;
uint16 *keylist = NULL, *curkey;
diff --git a/source3/rpcclient/rpcclient.h b/source3/rpcclient/rpcclient.h
index 3276a62437..ae5b5f3c4f 100644
--- a/source3/rpcclient/rpcclient.h
+++ b/source3/rpcclient/rpcclient.h
@@ -23,12 +23,12 @@
#define RPCCLIENT_H
struct cmd_set {
- const char *name;
+ char *name;
NTSTATUS (*fn)(struct cli_state*, TALLOC_CTX *mem_ctx, int argc,
char **argv);
int pipe_idx;
- const char *description;
- const char *usage;
+ char *description;
+ char *usage;
};
#endif /* RPCCLIENT_H */