s3:rpcclient: Use C99 initializer for cmd_set in cmd_lsarpc
authorAndreas Schneider <asn@samba.org>
Fri, 11 Jan 2019 13:05:57 +0000 (14:05 +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/cmd_lsarpc.c

index 4de511c7446a9b079875bfa317f44634cb1a0823..abb454331c2fc3d68c23b4ac1542307c13993dd1 100644 (file)
@@ -2377,42 +2377,341 @@ static NTSTATUS cmd_lsa_delete_trusted_domain(struct rpc_pipe_client *cli,
 
 struct cmd_set lsarpc_commands[] = {
 
-       { "LSARPC" },
-
-       { "lsaquery",            RPC_RTYPE_NTSTATUS, cmd_lsa_query_info_policy,  NULL, &ndr_table_lsarpc, NULL, "Query info policy",                    "" },
-       { "lookupsids",          RPC_RTYPE_NTSTATUS, cmd_lsa_lookup_sids,        NULL, &ndr_table_lsarpc, NULL, "Convert SIDs to names",                "" },
-       { "lookupsids3",         RPC_RTYPE_NTSTATUS, cmd_lsa_lookup_sids3,       NULL, &ndr_table_lsarpc, NULL, "Convert SIDs to names",                "" },
-       { "lookupsids_level",    RPC_RTYPE_NTSTATUS, cmd_lsa_lookup_sids_level,  NULL, &ndr_table_lsarpc, NULL, "Convert SIDs to names",                "" },
-       { "lookupnames",         RPC_RTYPE_NTSTATUS, cmd_lsa_lookup_names,       NULL, &ndr_table_lsarpc, NULL, "Convert names to SIDs",                "" },
-       { "lookupnames4",        RPC_RTYPE_NTSTATUS, cmd_lsa_lookup_names4,      NULL, &ndr_table_lsarpc, NULL, "Convert names to SIDs",                "" },
-       { "lookupnames_level",   RPC_RTYPE_NTSTATUS, cmd_lsa_lookup_names_level, NULL, &ndr_table_lsarpc, NULL, "Convert names to SIDs",                "" },
-       { "enumtrust",           RPC_RTYPE_NTSTATUS, cmd_lsa_enum_trust_dom,     NULL, &ndr_table_lsarpc, NULL, "Enumerate trusted domains",            "Usage: [preferred max number] [enum context (0)]" },
-       { "enumprivs",           RPC_RTYPE_NTSTATUS, cmd_lsa_enum_privilege,     NULL, &ndr_table_lsarpc, NULL, "Enumerate privileges",                 "" },
-       { "getdispname",         RPC_RTYPE_NTSTATUS, cmd_lsa_get_dispname,       NULL, &ndr_table_lsarpc, NULL, "Get the privilege name",               "" },
-       { "lsaenumsid",          RPC_RTYPE_NTSTATUS, cmd_lsa_enum_sids,          NULL, &ndr_table_lsarpc, NULL, "Enumerate the LSA SIDS",               "" },
-       { "lsacreateaccount",    RPC_RTYPE_NTSTATUS, cmd_lsa_create_account,     NULL, &ndr_table_lsarpc, NULL, "Create a new lsa account",   "" },
-       { "lsaenumprivsaccount", RPC_RTYPE_NTSTATUS, cmd_lsa_enum_privsaccounts, NULL, &ndr_table_lsarpc, NULL, "Enumerate the privileges of an SID",   "" },
-       { "lsaenumacctrights",   RPC_RTYPE_NTSTATUS, cmd_lsa_enum_acct_rights,   NULL, &ndr_table_lsarpc, NULL, "Enumerate the rights of an SID",   "" },
-       { "lsaaddpriv",          RPC_RTYPE_NTSTATUS, cmd_lsa_add_priv,           NULL, &ndr_table_lsarpc, NULL, "Assign a privilege to a SID", "" },
-       { "lsadelpriv",          RPC_RTYPE_NTSTATUS, cmd_lsa_del_priv,           NULL, &ndr_table_lsarpc, NULL, "Revoke a privilege from a SID", "" },
-       { "lsaaddacctrights",    RPC_RTYPE_NTSTATUS, cmd_lsa_add_acct_rights,    NULL, &ndr_table_lsarpc, NULL, "Add rights to an account",   "" },
-       { "lsaremoveacctrights", RPC_RTYPE_NTSTATUS, cmd_lsa_remove_acct_rights, NULL, &ndr_table_lsarpc, NULL, "Remove rights from an account",   "" },
-       { "lsalookupprivvalue",  RPC_RTYPE_NTSTATUS, cmd_lsa_lookup_priv_value,  NULL, &ndr_table_lsarpc, NULL, "Get a privilege value given its name", "" },
-       { "lsaquerysecobj",      RPC_RTYPE_NTSTATUS, cmd_lsa_query_secobj,       NULL, &ndr_table_lsarpc, NULL, "Query LSA security object", "" },
-       { "lsaquerytrustdominfo",RPC_RTYPE_NTSTATUS, cmd_lsa_query_trustdominfo, NULL, &ndr_table_lsarpc, NULL, "Query LSA trusted domains info (given a SID)", "" },
-       { "lsaquerytrustdominfobyname",RPC_RTYPE_NTSTATUS, cmd_lsa_query_trustdominfobyname, NULL, &ndr_table_lsarpc, NULL, "Query LSA trusted domains info (given a name), only works for Windows > 2k", "" },
-       { "lsaquerytrustdominfobysid",RPC_RTYPE_NTSTATUS, cmd_lsa_query_trustdominfobysid, NULL, &ndr_table_lsarpc, NULL, "Query LSA trusted domains info (given a SID)", "" },
-       { "lsasettrustdominfo",   RPC_RTYPE_NTSTATUS, cmd_lsa_set_trustdominfo, NULL, &ndr_table_lsarpc, NULL, "Set LSA trusted domain info", "" },
-       { "getusername",          RPC_RTYPE_NTSTATUS, cmd_lsa_get_username, NULL, &ndr_table_lsarpc, NULL, "Get username", "" },
-       { "createsecret",         RPC_RTYPE_NTSTATUS, cmd_lsa_create_secret, NULL, &ndr_table_lsarpc, NULL, "Create Secret", "" },
-       { "deletesecret",         RPC_RTYPE_NTSTATUS, cmd_lsa_delete_secret, NULL, &ndr_table_lsarpc, NULL, "Delete Secret", "" },
-       { "querysecret",          RPC_RTYPE_NTSTATUS, cmd_lsa_query_secret, NULL, &ndr_table_lsarpc, NULL, "Query Secret", "" },
-       { "setsecret",            RPC_RTYPE_NTSTATUS, cmd_lsa_set_secret, NULL, &ndr_table_lsarpc, NULL, "Set Secret", "" },
-       { "retrieveprivatedata",  RPC_RTYPE_NTSTATUS, cmd_lsa_retrieve_private_data, NULL, &ndr_table_lsarpc, NULL, "Retrieve Private Data", "" },
-       { "storeprivatedata",     RPC_RTYPE_NTSTATUS, cmd_lsa_store_private_data, NULL, &ndr_table_lsarpc, NULL, "Store Private Data", "" },
-       { "createtrustdom",       RPC_RTYPE_NTSTATUS, cmd_lsa_create_trusted_domain, NULL, &ndr_table_lsarpc, NULL, "Create Trusted Domain", "" },
-       { "deletetrustdom",       RPC_RTYPE_NTSTATUS, cmd_lsa_delete_trusted_domain, NULL, &ndr_table_lsarpc, NULL, "Delete Trusted Domain", "" },
-
-       { NULL }
-};
+       {
+               .name = "LSARPC",
+       },
 
+       {
+               .name               = "lsaquery",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_query_info_policy,
+               .wfn                =  NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Query info policy",
+               .usage              = "",
+       },
+       {
+               .name               = "lookupsids",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_lookup_sids,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Convert SIDs to names",
+               .usage              = "",
+       },
+       {
+               .name               = "lookupsids3",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_lookup_sids3,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Convert SIDs to names",
+               .usage              = "",
+       },
+       {
+               .name               = "lookupsids_level",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_lookup_sids_level,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Convert SIDs to names",
+               .usage              = "",
+       },
+       {
+               .name               = "lookupnames",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_lookup_names,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Convert names to SIDs",
+               .usage              = "",
+       },
+       {
+               .name               = "lookupnames4",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_lookup_names4,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Convert names to SIDs",
+               .usage              = "",
+       },
+       {
+               .name               = "lookupnames_level",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_lookup_names_level,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Convert names to SIDs",
+               .usage              = "",
+       },
+       {
+               .name               = "enumtrust",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_enum_trust_dom,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Enumerate trusted domains",
+               .usage              = "Usage: [preferred max number] [enum context (0)]",
+       },
+       {
+               .name               = "enumprivs",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_enum_privilege,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Enumerate privileges",
+               .usage              = "",
+       },
+       {
+               .name               = "getdispname",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_get_dispname,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Get the privilege name",
+               .usage              = "",
+       },
+       {
+               .name               = "lsaenumsid",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_enum_sids,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Enumerate the LSA SIDS",
+               .usage              = "",
+       },
+       {
+               .name               = "lsacreateaccount",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_create_account,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Create a new lsa account",
+               .usage              = "",
+       },
+       {
+               .name               = "lsaenumprivsaccount",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_enum_privsaccounts,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Enumerate the privileges of an SID",
+               .usage              = "",
+       },
+       {
+               .name               = "lsaenumacctrights",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_enum_acct_rights,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Enumerate the rights of an SID",
+               .usage              = "",
+       },
+       {
+               .name               = "lsaaddpriv",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_add_priv,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Assign a privilege to a SID",
+               .usage              = "",
+       },
+       {
+               .name               = "lsadelpriv",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_del_priv,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Revoke a privilege from a SID",
+               .usage              = "",
+       },
+       {
+               .name               = "lsaaddacctrights",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_add_acct_rights,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Add rights to an account",
+               .usage              = "",
+       },
+       {
+               .name               = "lsaremoveacctrights",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_remove_acct_rights,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Remove rights from an account",
+               .usage              = "",
+       },
+       {
+               .name               = "lsalookupprivvalue",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_lookup_priv_value,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Get a privilege value given its name",
+               .usage              = "",
+       },
+       {
+               .name               = "lsaquerysecobj",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_query_secobj,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Query LSA security object",
+               .usage              = "",
+       },
+       {
+               .name               = "lsaquerytrustdominfo",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_query_trustdominfo,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Query LSA trusted domains info (given a SID)",
+               .usage              = "",
+       },
+       {
+               .name               = "lsaquerytrustdominfobyname",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_query_trustdominfobyname,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Query LSA trusted domains info (given a name), only works for Windows > 2k",
+               .usage              = "",
+       },
+       {
+               .name               = "lsaquerytrustdominfobysid",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_query_trustdominfobysid,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Query LSA trusted domains info (given a SID)",
+               .usage              = "",
+       },
+       {
+               .name               = "lsasettrustdominfo",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_set_trustdominfo,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Set LSA trusted domain info",
+               .usage              = "",
+       },
+       {
+               .name               = "getusername",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_get_username,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Get username",
+               .usage              = "",
+       },
+       {
+               .name               = "createsecret",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_create_secret,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Create Secret",
+               .usage              = "",
+       },
+       {
+               .name               = "deletesecret",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_delete_secret,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Delete Secret",
+               .usage              = "",
+       },
+       {
+               .name               = "querysecret",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_query_secret,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Query Secret",
+               .usage              = "",
+       },
+       {
+               .name               = "setsecret",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_set_secret,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Set Secret",
+               .usage              = "",
+       },
+       {
+               .name               = "retrieveprivatedata",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_retrieve_private_data,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Retrieve Private Data",
+               .usage              = "",
+       },
+       {
+               .name               = "storeprivatedata",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_store_private_data,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Store Private Data",
+               .usage              = "",
+       },
+       {
+               .name               = "createtrustdom",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_create_trusted_domain,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Create Trusted Domain",
+               .usage              = "",
+       },
+       {
+               .name               = "deletetrustdom",
+               .returntype         = RPC_RTYPE_NTSTATUS,
+               .ntfn               = cmd_lsa_delete_trusted_domain,
+               .wfn                = NULL,
+               .table              = &ndr_table_lsarpc,
+               .rpc_pipe           = NULL,
+               .description        = "Delete Trusted Domain",
+               .usage              = "",
+       },
+       {
+               .name = NULL,
+       },
+};