s3:rpcclient: Use C99 initializer for cmd_set in rpcclient
authorAndreas Schneider <asn@samba.org>
Fri, 11 Jan 2019 13:16:11 +0000 (14:16 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 28 Jan 2019 09:29:19 +0000 (10:29 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source3/rpcclient/rpcclient.c

index 6cfacb19cfe49ae3ecb589edb5331c1629a47d72..4497bb622429a35b715483f63787b9127a5cc069 100644 (file)
@@ -608,30 +608,174 @@ static NTSTATUS cmd_choose_transport(struct rpc_pipe_client *cli, TALLOC_CTX *me
 
 static struct cmd_set rpcclient_commands[] = {
 
-       { "GENERAL OPTIONS" },
-
-       { "help", RPC_RTYPE_NTSTATUS, cmd_help, NULL,     NULL, NULL,   "Get help on commands", "[command]" },
-       { "?",  RPC_RTYPE_NTSTATUS, cmd_help, NULL,       NULL, NULL,   "Get help on commands", "[command]" },
-       { "debuglevel", RPC_RTYPE_NTSTATUS, cmd_debuglevel, NULL,   NULL,       NULL, "Set debug level", "level" },
-       { "debug", RPC_RTYPE_NTSTATUS, cmd_debuglevel, NULL,   NULL,    NULL, "Set debug level", "level" },
-       { "list",       RPC_RTYPE_NTSTATUS, cmd_listcommands, NULL, NULL,       NULL, "List available commands on <pipe>", "pipe" },
-       { "exit", RPC_RTYPE_NTSTATUS, cmd_quit, NULL,   NULL,   NULL,   "Exit program", "" },
-       { "quit", RPC_RTYPE_NTSTATUS, cmd_quit, NULL,     NULL, NULL, "Exit program", "" },
-       { "sign", RPC_RTYPE_NTSTATUS, cmd_sign, NULL,     NULL, NULL, "Force RPC pipe connections to be signed", "" },
-       { "seal", RPC_RTYPE_NTSTATUS, cmd_seal, NULL,     NULL, NULL, "Force RPC pipe connections to be sealed", "" },
-       { "packet", RPC_RTYPE_NTSTATUS, cmd_packet, NULL,         NULL, NULL, "Force RPC pipe connections with packet authentication level", "" },
-       { "schannel", RPC_RTYPE_NTSTATUS, cmd_schannel, NULL,     NULL, NULL,   "Force RPC pipe connections to be sealed with 'schannel'.  Assumes valid machine account to this domain controller.", "" },
-       { "schannelsign", RPC_RTYPE_NTSTATUS, cmd_schannel_sign, NULL,    NULL, NULL, "Force RPC pipe connections to be signed (not sealed) with 'schannel'.  Assumes valid machine account to this domain controller.", "" },
-       { "timeout", RPC_RTYPE_NTSTATUS, cmd_timeout, NULL,       NULL, NULL, "Set timeout (in milliseconds) for RPC operations", "" },
-       { "transport", RPC_RTYPE_NTSTATUS, cmd_choose_transport, NULL,    NULL, NULL, "Choose ncacn transport for RPC operations", "" },
-       { "none", RPC_RTYPE_NTSTATUS, cmd_none, NULL,     NULL, NULL, "Force RPC pipe connections to have no special properties", "" },
-
-       { NULL }
+       {
+               .name = "GENERAL OPTIONS",
+       },
+
+       {
+               .name               = "help",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_help,
+               .wfn                = NULL,
+               .table              = NULL,
+               .rpc_pipe           = NULL,
+               .description        = "Get help on commands",
+               .usage              = "[command]",
+       },
+       {
+               .name               = "?",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_help,
+               .wfn                = NULL,
+               .table              = NULL,
+               .rpc_pipe           = NULL,
+               .description        = "Get help on commands",
+               .usage              = "[command]",
+       },
+       {
+               .name               = "debuglevel",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_debuglevel,
+               .wfn                = NULL,
+               .table              = NULL,
+               .rpc_pipe           = NULL,
+               .description        = "Set debug level",
+               .usage              = "level",
+       },
+       {
+               .name               = "debug",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_debuglevel,
+               .wfn                = NULL,
+               .table              = NULL,
+               .rpc_pipe           = NULL,
+               .description        = "Set debug level",
+               .usage              = "level",
+       },
+       {
+               .name               = "list",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_listcommands,
+               .wfn                = NULL,
+               .table              = NULL,
+               .rpc_pipe           = NULL,
+               .description        = "List available commands on <pipe>",
+               .usage              = "pipe",
+       },
+       {
+               .name               = "exit",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_quit,
+               .wfn                = NULL,
+               .table              = NULL,
+               .rpc_pipe           = NULL,
+               .description        = "Exit program",
+               .usage              = "",
+       },
+       {
+               .name               = "quit",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_quit,
+               .wfn                = NULL,
+               .table              = NULL,
+               .rpc_pipe           = NULL,
+               .description        = "Exit program",
+               .usage              = "",
+       },
+       {
+               .name               = "sign",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_sign,
+               .wfn                = NULL,
+               .table              = NULL,
+               .rpc_pipe           = NULL,
+               .description        = "Force RPC pipe connections to be signed",
+               .usage              = "",
+       },
+       {
+               .name               = "seal",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_seal,
+               .wfn                = NULL,
+               .table              = NULL,
+               .rpc_pipe           = NULL,
+               .description        = "Force RPC pipe connections to be sealed",
+               .usage              = "",
+       },
+       {
+               .name               = "packet",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_packet,
+               .wfn                = NULL,
+               .table              = NULL,
+               .rpc_pipe           = NULL,
+               .description        = "Force RPC pipe connections with packet authentication level",
+               .usage              = "",
+       },
+       {
+               .name               = "schannel",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_schannel,
+               .wfn                = NULL,
+               .table              = NULL,
+               .rpc_pipe           = NULL,
+               .description        = "Force RPC pipe connections to be sealed with 'schannel'. "
+                                     "Assumes valid machine account to this domain controller.",
+               .usage              = "",
+       },
+       {
+               .name               = "schannelsign",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_schannel_sign,
+               .wfn                = NULL,
+               .table              = NULL,
+               .rpc_pipe           = NULL,
+               .description        = "Force RPC pipe connections to be signed (not sealed) with "
+                                     "'schannel'.  Assumes valid machine account to this domain "
+                                     "controller.",
+               .usage              = "",
+       },
+       {
+               .name               = "timeout",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_timeout,
+               .wfn                = NULL,
+               .table              = NULL,
+               .rpc_pipe           = NULL,
+               .description        = "Set timeout (in milliseconds) for RPC operations",
+               .usage              = "",
+       },
+       {
+               .name               = "transport",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_choose_transport,
+               .wfn                = NULL,
+               .table              = NULL,
+               .rpc_pipe           = NULL,
+               .description        = "Choose ncacn transport for RPC operations",
+               .usage              = "",
+       },
+       {
+               .name               = "none",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_none,
+               .wfn                = NULL,
+               .table              = NULL,
+               .rpc_pipe           = NULL,
+               .description        = "Force RPC pipe connections to have no special properties",
+               .usage              = "",
+       },
+
+       { .name = NULL, },
 };
 
 static struct cmd_set separator_command[] = {
-       { "---------------", MAX_RPC_RETURN_TYPE, NULL, NULL,   NULL, NULL, "----------------------" },
-       { NULL }
+       {
+               .name               = "---------------",
+               .returntype         = MAX_RPC_RETURN_TYPE,
+               .description        = "----------------------"
+       },
+       { .name = NULL, },
 };