summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-02-25 06:24:13 +0000
committerTim Potter <tpot@samba.org>2003-02-25 06:24:13 +0000
commit3a2f56cb630a7566ef0a70052b3102651bf653cc (patch)
tree1a76017aa0d4bc52de8b3d78a71c83d6409936e2 /source3
parent589371e1d5844be9ea0da4c674635ccc42ab9498 (diff)
downloadsamba-3a2f56cb630a7566ef0a70052b3102651bf653cc.tar.gz
samba-3a2f56cb630a7566ef0a70052b3102651bf653cc.tar.bz2
samba-3a2f56cb630a7566ef0a70052b3102651bf653cc.zip
Fixed up some const related compiler warnings.
(This used to be commit 923425e497112c5d1e2e569da6c13dcd02b6a8af)
Diffstat (limited to 'source3')
-rw-r--r--source3/client/client.c9
-rw-r--r--source3/rpcclient/cmd_lsarpc.c24
-rw-r--r--source3/rpcclient/cmd_samr.c38
-rw-r--r--source3/rpcclient/rpcclient.c6
-rw-r--r--source3/rpcclient/rpcclient.h4
5 files changed, 42 insertions, 39 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 5da12fd984..b95d4d877c 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -51,7 +51,8 @@ static int max_protocol = PROTOCOL_NT1;
extern pstring user_socket_options;
static int process_tok(fstring tok);
-static int cmd_help(void);
+static NTSTATUS cmd_help(struct cli_state *cli, TALLOC_CTX *mem_ctx, int argc,
+ const char **argv);
/* 30 second timeout on most commands */
#define CLIENT_TIMEOUT (30*1000)
@@ -979,7 +980,8 @@ static BOOL do_altname(char *name)
/****************************************************************************
Exit client.
****************************************************************************/
-static int cmd_quit(void)
+static NTSTATUS cmd_quit(struct cli_state *cli, TALLOC_CTX *mem_ctx, int argc,
+ const char **argv)
{
cli_shutdown(cli);
exit(0);
@@ -2149,7 +2151,8 @@ static int process_tok(fstring tok)
/****************************************************************************
help
****************************************************************************/
-static int cmd_help(void)
+static NTSTATUS cmd_help(struct cli_state *cli, TALLOC_CTX *mem_ctx, int argc,
+ const char **argv)
{
int i=0,j;
fstring buf;
diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c
index 03df170c09..fab6a89ed5 100644
--- a/source3/rpcclient/cmd_lsarpc.c
+++ b/source3/rpcclient/cmd_lsarpc.c
@@ -64,7 +64,7 @@ done:
static NTSTATUS cmd_lsa_query_info_policy(struct cli_state *cli,
TALLOC_CTX *mem_ctx, int argc,
- char **argv)
+ const char **argv)
{
POLICY_HND pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -134,7 +134,7 @@ static NTSTATUS cmd_lsa_query_info_policy(struct cli_state *cli,
static NTSTATUS cmd_lsa_lookup_names(struct cli_state *cli,
TALLOC_CTX *mem_ctx, int argc,
- char **argv)
+ const char **argv)
{
POLICY_HND pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -179,7 +179,7 @@ static NTSTATUS cmd_lsa_lookup_names(struct cli_state *cli,
/* Resolve a list of SIDs to a list of names */
static NTSTATUS cmd_lsa_lookup_sids(struct cli_state *cli, TALLOC_CTX *mem_ctx,
- int argc, char **argv)
+ int argc, const char **argv)
{
POLICY_HND pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -246,7 +246,7 @@ static NTSTATUS cmd_lsa_lookup_sids(struct cli_state *cli, TALLOC_CTX *mem_ctx,
static NTSTATUS cmd_lsa_enum_trust_dom(struct cli_state *cli,
TALLOC_CTX *mem_ctx, int argc,
- char **argv)
+ const char **argv)
{
POLICY_HND pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -301,7 +301,7 @@ static NTSTATUS cmd_lsa_enum_trust_dom(struct cli_state *cli,
static NTSTATUS cmd_lsa_enum_privilege(struct cli_state *cli,
TALLOC_CTX *mem_ctx, int argc,
- char **argv)
+ const char **argv)
{
POLICY_HND pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -354,7 +354,7 @@ static NTSTATUS cmd_lsa_enum_privilege(struct cli_state *cli,
static NTSTATUS cmd_lsa_get_dispname(struct cli_state *cli,
TALLOC_CTX *mem_ctx, int argc,
- char **argv)
+ const char **argv)
{
POLICY_HND pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -392,7 +392,7 @@ static NTSTATUS cmd_lsa_get_dispname(struct cli_state *cli,
static NTSTATUS cmd_lsa_enum_sids(struct cli_state *cli,
TALLOC_CTX *mem_ctx, int argc,
- char **argv)
+ const char **argv)
{
POLICY_HND pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -445,7 +445,7 @@ static NTSTATUS cmd_lsa_enum_sids(struct cli_state *cli,
static NTSTATUS cmd_lsa_enum_privsaccounts(struct cli_state *cli,
TALLOC_CTX *mem_ctx, int argc,
- char **argv)
+ const char **argv)
{
POLICY_HND dom_pol;
POLICY_HND user_pol;
@@ -500,7 +500,7 @@ static NTSTATUS cmd_lsa_enum_privsaccounts(struct cli_state *cli,
static NTSTATUS cmd_lsa_enum_acct_rights(struct cli_state *cli,
TALLOC_CTX *mem_ctx, int argc,
- char **argv)
+ const char **argv)
{
POLICY_HND dom_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -666,8 +666,8 @@ static NTSTATUS cmd_lsa_remove_acct_rights(struct cli_state *cli,
/* Get a privilege value given its name */
static NTSTATUS cmd_lsa_lookupprivvalue(struct cli_state *cli,
- TALLOC_CTX *mem_ctx, int argc,
- char **argv)
+ TALLOC_CTX *mem_ctx, int argc,
+ const char **argv)
{
POLICY_HND pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -702,7 +702,7 @@ static NTSTATUS cmd_lsa_lookupprivvalue(struct cli_state *cli,
static NTSTATUS cmd_lsa_query_secobj(struct cli_state *cli,
TALLOC_CTX *mem_ctx, int argc,
- char **argv)
+ const char **argv)
{
POLICY_HND pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index 85aface7be..cec6b1680b 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -264,7 +264,7 @@ static NTSTATUS try_samr_connects(struct cli_state *cli, TALLOC_CTX *mem_ctx,
*/
static NTSTATUS cmd_samr_query_user(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
- int argc, char **argv)
+ int argc, const char **argv)
{
POLICY_HND connect_pol, domain_pol, user_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -373,7 +373,7 @@ static void display_group_info_ctr(GROUP_INFO_CTR *ctr)
*/
static NTSTATUS cmd_samr_query_group(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
- int argc, char **argv)
+ int argc, const char **argv)
{
POLICY_HND connect_pol, domain_pol, group_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -435,7 +435,7 @@ done:
static NTSTATUS cmd_samr_query_usergroups(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
- int argc, char **argv)
+ int argc, const char **argv)
{
POLICY_HND connect_pol,
domain_pol,
@@ -499,8 +499,8 @@ static NTSTATUS cmd_samr_query_usergroups(struct cli_state *cli,
/* Query aliases a user is a member of */
static NTSTATUS cmd_samr_query_useraliases(struct cli_state *cli,
- TALLOC_CTX *mem_ctx,
- int argc, char **argv)
+ TALLOC_CTX *mem_ctx,
+ int argc, const char **argv)
{
POLICY_HND connect_pol, domain_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -568,7 +568,7 @@ static NTSTATUS cmd_samr_query_useraliases(struct cli_state *cli,
static NTSTATUS cmd_samr_query_groupmem(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
- int argc, char **argv)
+ int argc, const char **argv)
{
POLICY_HND connect_pol, domain_pol, group_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -630,7 +630,7 @@ static NTSTATUS cmd_samr_query_groupmem(struct cli_state *cli,
static NTSTATUS cmd_samr_enum_dom_users(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
- int argc, char **argv)
+ int argc, const char **argv)
{
POLICY_HND connect_pol, domain_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -704,7 +704,7 @@ static NTSTATUS cmd_samr_enum_dom_users(struct cli_state *cli,
static NTSTATUS cmd_samr_enum_dom_groups(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
- int argc, char **argv)
+ int argc, const char **argv)
{
POLICY_HND connect_pol, domain_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -777,7 +777,7 @@ static NTSTATUS cmd_samr_enum_dom_groups(struct cli_state *cli,
static NTSTATUS cmd_samr_enum_als_groups(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
- int argc, char **argv)
+ int argc, const char **argv)
{
POLICY_HND connect_pol, domain_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -859,7 +859,7 @@ static NTSTATUS cmd_samr_enum_als_groups(struct cli_state *cli,
static NTSTATUS cmd_samr_query_aliasmem(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
- int argc, char **argv)
+ int argc, const char **argv)
{
POLICY_HND connect_pol, domain_pol, alias_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -933,7 +933,7 @@ static NTSTATUS cmd_samr_query_aliasmem(struct cli_state *cli,
static NTSTATUS cmd_samr_query_dispinfo(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
- int argc, char **argv)
+ int argc, const char **argv)
{
POLICY_HND connect_pol, domain_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -1067,7 +1067,7 @@ static NTSTATUS cmd_samr_query_dispinfo(struct cli_state *cli,
static NTSTATUS cmd_samr_query_dominfo(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
- int argc, char **argv)
+ int argc, const char **argv)
{
POLICY_HND connect_pol, domain_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -1137,11 +1137,11 @@ static NTSTATUS cmd_samr_query_dominfo(struct cli_state *cli,
static NTSTATUS cmd_samr_create_dom_user(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
- int argc, char **argv)
+ int argc, const char **argv)
{
POLICY_HND connect_pol, domain_pol, user_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- char *acct_name;
+ const char *acct_name;
uint16 acb_info;
uint32 unknown, user_rid;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
@@ -1193,7 +1193,7 @@ static NTSTATUS cmd_samr_create_dom_user(struct cli_state *cli,
static NTSTATUS cmd_samr_lookup_names(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
- int argc, char **argv)
+ int argc, const char **argv)
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
POLICY_HND connect_pol, domain_pol;
@@ -1263,7 +1263,7 @@ static NTSTATUS cmd_samr_lookup_names(struct cli_state *cli,
static NTSTATUS cmd_samr_lookup_rids(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
- int argc, char **argv)
+ int argc, const char **argv)
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
POLICY_HND connect_pol, domain_pol;
@@ -1320,7 +1320,7 @@ static NTSTATUS cmd_samr_lookup_rids(struct cli_state *cli,
static NTSTATUS cmd_samr_delete_dom_user(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
- int argc, char **argv)
+ int argc, const char **argv)
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
POLICY_HND connect_pol, domain_pol, user_pol;
@@ -1389,7 +1389,7 @@ static NTSTATUS cmd_samr_delete_dom_user(struct cli_state *cli,
*/
static NTSTATUS cmd_samr_query_sec_obj(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
- int argc, char **argv)
+ int argc, const char **argv)
{
POLICY_HND connect_pol, domain_pol, user_pol, *pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
@@ -1466,7 +1466,7 @@ done:
static NTSTATUS cmd_samr_get_dom_pwinfo(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
- int argc, char **argv)
+ int argc, const char **argv)
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint16 unk_0, unk_1, unk_2;
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index 7a9c464cf6..5803055598 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -259,7 +259,7 @@ static void fetch_machine_sid(struct cli_state *cli)
/* List the available commands on a given pipe */
static NTSTATUS cmd_listcommands(struct cli_state *cli, TALLOC_CTX *mem_ctx,
- int argc, char **argv)
+ int argc, const char **argv)
{
struct cmd_list *tmp;
struct cmd_set *tmp_set;
@@ -364,7 +364,7 @@ static NTSTATUS cmd_help(struct cli_state *cli, TALLOC_CTX *mem_ctx,
/* Change the debug level */
static NTSTATUS cmd_debuglevel(struct cli_state *cli, TALLOC_CTX *mem_ctx,
- int argc, char **argv)
+ int argc, const char **argv)
{
if (argc > 2) {
printf("Usage: %s [debuglevel]\n", argv[0]);
@@ -479,7 +479,7 @@ static NTSTATUS do_cmd(struct cli_state *cli,
/* Run command */
- result = cmd_entry->fn(cli, mem_ctx, argc, (char **) argv);
+ result = cmd_entry->fn(cli, mem_ctx, argc, (const char **) argv);
/* Cleanup */
diff --git a/source3/rpcclient/rpcclient.h b/source3/rpcclient/rpcclient.h
index 3276a62437..1bd3c1a641 100644
--- a/source3/rpcclient/rpcclient.h
+++ b/source3/rpcclient/rpcclient.h
@@ -24,8 +24,8 @@
struct cmd_set {
const char *name;
- NTSTATUS (*fn)(struct cli_state*, TALLOC_CTX *mem_ctx, int argc,
- char **argv);
+ NTSTATUS (*fn)(struct cli_state *cli, TALLOC_CTX *mem_ctx, int argc,
+ const char **argv);
int pipe_idx;
const char *description;
const char *usage;