s3:rpcclient: Use C99 initializer for cmd_set in cmd_srvsvc
authorAndreas Schneider <asn@samba.org>
Tue, 8 Jan 2019 17:06:43 +0000 (18:06 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 28 Jan 2019 09:29:17 +0000 (10:29 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source3/rpcclient/cmd_srvsvc.c

index f78fb9a135d2305b51737bd0e23ff09207568e46..2dec04004466a062eb3d6304712283b1e93f75dd 100644 (file)
@@ -1087,24 +1087,172 @@ static WERROR cmd_srvsvc_net_share_del(struct rpc_pipe_client *cli,
 
 struct cmd_set srvsvc_commands[] = {
 
-       { "SRVSVC" },
-
-       { "srvinfo",     RPC_RTYPE_WERROR, NULL, cmd_srvsvc_srv_query_info, &ndr_table_srvsvc, NULL, "Server query info", "" },
-       { "netshareenum",RPC_RTYPE_WERROR, NULL, cmd_srvsvc_net_share_enum, &ndr_table_srvsvc, NULL, "Enumerate shares", "" },
-       { "netshareenumall",RPC_RTYPE_WERROR, NULL, cmd_srvsvc_net_share_enum_all, &ndr_table_srvsvc, NULL, "Enumerate all shares", "" },
-       { "netsharegetinfo",RPC_RTYPE_WERROR, NULL, cmd_srvsvc_net_share_get_info, &ndr_table_srvsvc, NULL, "Get Share Info", "" },
-       { "netsharesetinfo",RPC_RTYPE_WERROR, NULL, cmd_srvsvc_net_share_set_info, &ndr_table_srvsvc, NULL, "Set Share Info", "" },
-       { "netsharesetdfsflags",RPC_RTYPE_WERROR, NULL, cmd_srvsvc_net_share_set_dfs_flags, &ndr_table_srvsvc, NULL, "Set DFS flags", "" },
-       { "netfileenum", RPC_RTYPE_WERROR, NULL, cmd_srvsvc_net_file_enum,  &ndr_table_srvsvc, NULL, "Enumerate open files", "" },
-       { "netremotetod",RPC_RTYPE_WERROR, NULL, cmd_srvsvc_net_remote_tod, &ndr_table_srvsvc, NULL, "Fetch remote time of day", "" },
-       { "netnamevalidate", RPC_RTYPE_WERROR, NULL, cmd_srvsvc_net_name_validate, &ndr_table_srvsvc, NULL, "Validate sharename", "" },
-       { "netfilegetsec", RPC_RTYPE_WERROR, NULL, cmd_srvsvc_net_file_get_sec, &ndr_table_srvsvc, NULL, "Get File security", "" },
-       { "netsessdel", RPC_RTYPE_WERROR, NULL, cmd_srvsvc_net_sess_del, &ndr_table_srvsvc, NULL, "Delete Session", "" },
-       { "netsessenum", RPC_RTYPE_WERROR, NULL, cmd_srvsvc_net_sess_enum, &ndr_table_srvsvc, NULL, "Enumerate Sessions", "" },
-       { "netdiskenum", RPC_RTYPE_WERROR, NULL, cmd_srvsvc_net_disk_enum, &ndr_table_srvsvc, NULL, "Enumerate Disks", "" },
-       { "netconnenum", RPC_RTYPE_WERROR, NULL, cmd_srvsvc_net_conn_enum, &ndr_table_srvsvc, NULL, "Enumerate Connections", "" },
-       { "netshareadd", RPC_RTYPE_WERROR, NULL, cmd_srvsvc_net_share_add, &ndr_table_srvsvc, NULL, "Add share", "" },
-       { "netsharedel", RPC_RTYPE_WERROR, NULL, cmd_srvsvc_net_share_del, &ndr_table_srvsvc, NULL, "Delete share", "" },
-
-       { NULL }
+       {
+               .name = "SRVSVC",
+       },
+
+       {
+               .name               = "srvinfo",
+               .returntype         = RPC_RTYPE_WERROR,
+               .ntfn               = NULL,
+               .wfn                = cmd_srvsvc_srv_query_info,
+               .table              = &ndr_table_srvsvc,
+               .rpc_pipe           = NULL,
+               .description        = "Server query info",
+               .usage              = "",
+       },
+       {
+               .name               = "netshareenum",
+               .returntype         = RPC_RTYPE_WERROR,
+               .ntfn               = NULL,
+               .wfn                = cmd_srvsvc_net_share_enum,
+               .table              = &ndr_table_srvsvc,
+               .rpc_pipe           = NULL,
+               .description        = "Enumerate shares",
+               .usage              = "",
+       },
+       {
+               .name               = "netshareenumall",
+               .returntype         = RPC_RTYPE_WERROR,
+               .ntfn               = NULL,
+               .wfn                = cmd_srvsvc_net_share_enum_all,
+               .table              = &ndr_table_srvsvc,
+               .rpc_pipe           = NULL,
+               .description        = "Enumerate all shares",
+               .usage              = "",
+       },
+       {
+               .name               = "netsharegetinfo",
+               .returntype         = RPC_RTYPE_WERROR,
+               .ntfn               = NULL,
+               .wfn                = cmd_srvsvc_net_share_get_info,
+               .table              = &ndr_table_srvsvc,
+               .rpc_pipe           = NULL,
+               .description        = "Get Share Info",
+               .usage              = "",
+       },
+       {
+               .name               = "netsharesetinfo",
+               .returntype         = RPC_RTYPE_WERROR,
+               .ntfn               = NULL,
+               .wfn                = cmd_srvsvc_net_share_set_info,
+               .table              = &ndr_table_srvsvc,
+               .rpc_pipe           = NULL,
+               .description        = "Set Share Info",
+               .usage              = "",
+       },
+       {
+               .name               = "netsharesetdfsflags",
+               .returntype         = RPC_RTYPE_WERROR,
+               .ntfn               = NULL,
+               .wfn                = cmd_srvsvc_net_share_set_dfs_flags,
+               .table              = &ndr_table_srvsvc,
+               .rpc_pipe           = NULL,
+               .description        = "Set DFS flags",
+               .usage              = "",
+       },
+       {
+               .name               = "netfileenum",
+               .returntype         = RPC_RTYPE_WERROR,
+               .ntfn               = NULL,
+               .wfn                = cmd_srvsvc_net_file_enum,
+               .table              =  &ndr_table_srvsvc,
+               .rpc_pipe           = NULL,
+               .description        = "Enumerate open files",
+               .usage              = "",
+       },
+       {
+               .name               = "netremotetod",
+               .returntype         = RPC_RTYPE_WERROR,
+               .ntfn               = NULL,
+               .wfn                = cmd_srvsvc_net_remote_tod,
+               .table              = &ndr_table_srvsvc,
+               .rpc_pipe           = NULL,
+               .description        = "Fetch remote time of day",
+               .usage              = "",
+       },
+       {
+               .name               = "netnamevalidate",
+               .returntype         = RPC_RTYPE_WERROR,
+               .ntfn               = NULL,
+               .wfn                = cmd_srvsvc_net_name_validate,
+               .table              = &ndr_table_srvsvc,
+               .rpc_pipe           = NULL,
+               .description        = "Validate sharename",
+               .usage              = "",
+       },
+       {
+               .name               = "netfilegetsec",
+               .returntype         = RPC_RTYPE_WERROR,
+               .ntfn               = NULL,
+               .wfn                = cmd_srvsvc_net_file_get_sec,
+               .table              = &ndr_table_srvsvc,
+               .rpc_pipe           = NULL,
+               .description        = "Get File security",
+               .usage              = "",
+       },
+       {
+               .name               = "netsessdel",
+               .returntype         = RPC_RTYPE_WERROR,
+               .ntfn               = NULL,
+               .wfn                = cmd_srvsvc_net_sess_del,
+               .table              = &ndr_table_srvsvc,
+               .rpc_pipe           = NULL,
+               .description        = "Delete Session",
+               .usage              = "",
+       },
+       {
+               .name               = "netsessenum",
+               .returntype         = RPC_RTYPE_WERROR,
+               .ntfn               = NULL,
+               .wfn                = cmd_srvsvc_net_sess_enum,
+               .table              = &ndr_table_srvsvc,
+               .rpc_pipe           = NULL,
+               .description        = "Enumerate Sessions",
+               .usage              = "",
+       },
+       {
+               .name               = "netdiskenum",
+               .returntype         = RPC_RTYPE_WERROR,
+               .ntfn               = NULL,
+               .wfn                = cmd_srvsvc_net_disk_enum,
+               .table              = &ndr_table_srvsvc,
+               .rpc_pipe           = NULL,
+               .description        = "Enumerate Disks",
+               .usage              = "",
+       },
+       {
+               .name               = "netconnenum",
+               .returntype         = RPC_RTYPE_WERROR,
+               .ntfn               = NULL,
+               .wfn                = cmd_srvsvc_net_conn_enum,
+               .table              = &ndr_table_srvsvc,
+               .rpc_pipe           = NULL,
+               .description        = "Enumerate Connections",
+               .usage              = "",
+       },
+       {
+               .name               = "netshareadd",
+               .returntype         = RPC_RTYPE_WERROR,
+               .ntfn               = NULL,
+               .wfn                = cmd_srvsvc_net_share_add,
+               .table              = &ndr_table_srvsvc,
+               .rpc_pipe           = NULL,
+               .description        = "Add share",
+               .usage              = "",
+       },
+       {
+               .name               = "netsharedel",
+               .returntype         = RPC_RTYPE_WERROR,
+               .ntfn               = NULL,
+               .wfn                = cmd_srvsvc_net_share_del,
+               .table              = &ndr_table_srvsvc,
+               .rpc_pipe           = NULL,
+               .description        = "Delete share",
+               .usage              = "",
+       },
+
+       {
+               .name = NULL,
+       }
 };