summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-11-08 12:24:06 +0100
committerVolker Lendecke <vl@samba.org>2009-11-08 13:12:15 +0100
commit53f2a1595e76db9fe1b42db65b51895b73365993 (patch)
tree704c28e54e7a3cb069de5d88c5e80f56194f4b8a /source3
parent494b2aff8826947e3bd556aecb175746163da485 (diff)
downloadsamba-53f2a1595e76db9fe1b42db65b51895b73365993.tar.gz
samba-53f2a1595e76db9fe1b42db65b51895b73365993.tar.bz2
samba-53f2a1595e76db9fe1b42db65b51895b73365993.zip
s3: Make run_rpc_command take strings instead of a ndr_interface_table
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/net.h3
-rw-r--r--source3/utils/net_dom.c19
-rw-r--r--source3/utils/net_proto.h3
-rw-r--r--source3/utils/net_rpc.c226
-rw-r--r--source3/utils/net_rpc_audit.c20
-rw-r--r--source3/utils/net_rpc_registry.c36
-rw-r--r--source3/utils/net_rpc_rights.c29
-rw-r--r--source3/utils/net_rpc_samsync.c23
-rw-r--r--source3/utils/net_rpc_service.c32
-rw-r--r--source3/utils/net_rpc_sh_acct.c25
-rw-r--r--source3/utils/net_rpc_shell.c21
11 files changed, 261 insertions, 176 deletions
diff --git a/source3/utils/net.h b/source3/utils/net.h
index 765b61bd56..ee06ded8d1 100644
--- a/source3/utils/net.h
+++ b/source3/utils/net.h
@@ -142,7 +142,8 @@ struct rpc_sh_cmd {
struct rpc_sh_cmd *(*sub)(struct net_context *c,
TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx);
- const struct ndr_syntax_id *interface;
+ const char *interface;
+ uint32_t interface_version;
NTSTATUS (*fn)(struct net_context *c, TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct rpc_pipe_client *pipe_hnd,
diff --git a/source3/utils/net_dom.c b/source3/utils/net_dom.c
index 433fb6c671..57d616b42c 100644
--- a/source3/utils/net_dom.c
+++ b/source3/utils/net_dom.c
@@ -100,14 +100,16 @@ static int net_dom_unjoin(struct net_context *c, int argc, const char **argv)
c->opt_timeout = 30;
ret = run_rpc_command(c, cli,
- &ndr_table_initshutdown.syntax_id,
+ NDR_INITSHUTDOWN_UUID,
+ NDR_INITSHUTDOWN_VERSION,
0, rpc_init_shutdown_internals,
argc, argv);
if (ret == 0) {
goto done;
}
- ret = run_rpc_command(c, cli, &ndr_table_winreg.syntax_id, 0,
+ ret = run_rpc_command(c, cli,
+ NDR_WINREG_UUID, NDR_WINREG_VERSION, 0,
rpc_reg_shutdown_internals,
argc, argv);
goto done;
@@ -206,14 +208,17 @@ static int net_dom_join(struct net_context *c, int argc, const char **argv)
c->opt_reboot = true;
c->opt_timeout = 30;
- ret = run_rpc_command(c, cli, &ndr_table_initshutdown.syntax_id, 0,
+ ret = run_rpc_command(c, cli,
+ NDR_INITSHUTDOWN_UUID,
+ NDR_INITSHUTDOWN_VERSION, 0,
rpc_init_shutdown_internals,
argc, argv);
if (ret == 0) {
goto done;
}
- ret = run_rpc_command(c, cli, &ndr_table_winreg.syntax_id, 0,
+ ret = run_rpc_command(c, cli,
+ NDR_WINREG_UUID, NDR_WINREG_VERSION, 0,
rpc_reg_shutdown_internals,
argc, argv);
goto done;
@@ -303,14 +308,16 @@ static int net_dom_renamecomputer(struct net_context *c, int argc, const char **
c->opt_timeout = 30;
ret = run_rpc_command(c, cli,
- &ndr_table_initshutdown.syntax_id,
+ NDR_INITSHUTDOWN_UUID,
+ NDR_INITSHUTDOWN_VERSION,
0, rpc_init_shutdown_internals,
argc, argv);
if (ret == 0) {
goto done;
}
- ret = run_rpc_command(c, cli, &ndr_table_winreg.syntax_id, 0,
+ ret = run_rpc_command(c, cli,
+ NDR_WINREG_UUID, NDR_WINREG_VERSION, 0,
rpc_reg_shutdown_internals,
argc, argv);
goto done;
diff --git a/source3/utils/net_proto.h b/source3/utils/net_proto.h
index 098e2a22be..92cd7a6737 100644
--- a/source3/utils/net_proto.h
+++ b/source3/utils/net_proto.h
@@ -158,7 +158,8 @@ NTSTATUS net_get_remote_domain_sid(struct cli_state *cli, TALLOC_CTX *mem_ctx,
const char **domain_name);
int run_rpc_command(struct net_context *c,
struct cli_state *cli_arg,
- const struct ndr_syntax_id *interface,
+ const char *interface,
+ uint32_t interface_version,
int conn_flags,
rpc_command_fn fn,
int argc,
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 4ef86d171b..d50a1f5313 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -109,7 +109,8 @@ NTSTATUS net_get_remote_domain_sid(struct cli_state *cli, TALLOC_CTX *mem_ctx,
int run_rpc_command(struct net_context *c,
struct cli_state *cli_arg,
- const struct ndr_syntax_id *interface,
+ const char *interface,
+ uint32_t interface_version,
int conn_flags,
rpc_command_fn fn,
int argc,
@@ -117,6 +118,7 @@ int run_rpc_command(struct net_context *c,
{
struct cli_state *cli = NULL;
struct rpc_pipe_client *pipe_hnd = NULL;
+ struct ndr_syntax_id syntax;
TALLOC_CTX *mem_ctx;
NTSTATUS nt_status;
DOM_SID *domain_sid;
@@ -139,6 +141,10 @@ int run_rpc_command(struct net_context *c,
return -1;
}
+ if (!ndr_syntax_from_string(interface, interface_version, &syntax)) {
+ return -1;
+ }
+
/* Create mem_ctx */
if (!(mem_ctx = talloc_init("run_rpc_command"))) {
@@ -154,11 +160,11 @@ int run_rpc_command(struct net_context *c,
if (!(conn_flags & NET_FLAGS_NO_PIPE)) {
if (lp_client_schannel()
- && (ndr_syntax_id_equal(interface,
+ && (ndr_syntax_id_equal(&syntax,
&ndr_table_netlogon.syntax_id))) {
/* Always try and create an schannel netlogon pipe. */
nt_status = cli_rpc_pipe_open_schannel(
- cli, interface, NCACN_NP,
+ cli, &syntax, NCACN_NP,
DCERPC_AUTH_LEVEL_PRIVACY, domain_name,
&pipe_hnd);
if (!NT_STATUS_IS_OK(nt_status)) {
@@ -169,7 +175,7 @@ int run_rpc_command(struct net_context *c,
} else {
if (conn_flags & NET_FLAGS_SEAL) {
nt_status = cli_rpc_pipe_open_ntlmssp(
- cli, interface,
+ cli, &syntax,
(conn_flags & NET_FLAGS_TCP) ?
NCACN_IP_TCP : NCACN_NP,
DCERPC_AUTH_LEVEL_PRIVACY,
@@ -177,13 +183,12 @@ int run_rpc_command(struct net_context *c,
c->opt_password, &pipe_hnd);
} else {
nt_status = cli_rpc_pipe_open_noauth(
- cli, interface,
- &pipe_hnd);
+ cli, &syntax, &pipe_hnd);
}
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("Could not initialise pipe %s. Error was %s\n",
get_pipe_name_from_syntax(
- talloc_tos(), interface),
+ talloc_tos(), &syntax),
nt_errstr(nt_status) ));
goto fail;
}
@@ -271,7 +276,8 @@ int net_rpc_changetrustpw(struct net_context *c, int argc, const char **argv)
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_netlogon.syntax_id,
+ return run_rpc_command(c, NULL, NDR_NETLOGON_UUID,
+ NDR_NETLOGON_VERSION,
NET_FLAGS_ANONYMOUS | NET_FLAGS_PDC,
rpc_changetrustpw_internals,
argc, argv);
@@ -373,7 +379,8 @@ static NTSTATUS rpc_oldjoin_internals(struct net_context *c,
static int net_rpc_perform_oldjoin(struct net_context *c, int argc, const char **argv)
{
- return run_rpc_command(c, NULL, &ndr_table_netlogon.syntax_id,
+ return run_rpc_command(c, NULL,
+ NDR_NETLOGON_UUID, NDR_NETLOGON_VERSION,
NET_FLAGS_NO_PIPE | NET_FLAGS_ANONYMOUS | NET_FLAGS_PDC,
rpc_oldjoin_internals,
argc, argv);
@@ -547,7 +554,7 @@ int net_rpc_info(struct net_context *c, int argc, const char **argv)
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id,
+ return run_rpc_command(c, NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
NET_FLAGS_PDC, rpc_info_internals,
argc, argv);
}
@@ -607,7 +614,7 @@ int net_rpc_getsid(struct net_context *c, int argc, const char **argv)
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id,
+ return run_rpc_command(c, NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
NET_FLAGS_ANONYMOUS | NET_FLAGS_PDC,
rpc_getsid_internals,
argc, argv);
@@ -1311,37 +1318,37 @@ struct rpc_sh_cmd *net_rpc_user_edit_cmds(struct net_context *c,
{
static struct rpc_sh_cmd cmds[] = {
- { "fullname", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_str_edit,
+ { "fullname", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_user_str_edit,
N_("Show/Set a user's full name") },
- { "homedir", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_str_edit,
+ { "homedir", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_user_str_edit,
N_("Show/Set a user's home directory") },
- { "homedrive", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_str_edit,
+ { "homedrive", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_user_str_edit,
N_("Show/Set a user's home drive") },
- { "logonscript", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_str_edit,
+ { "logonscript", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_user_str_edit,
N_("Show/Set a user's logon script") },
- { "profilepath", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_str_edit,
+ { "profilepath", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_user_str_edit,
N_("Show/Set a user's profile path") },
- { "description", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_str_edit,
+ { "description", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_user_str_edit,
N_("Show/Set a user's description") },
- { "disabled", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_flag_edit,
+ { "disabled", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_user_flag_edit,
N_("Show/Set whether a user is disabled") },
- { "autolock", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_flag_edit,
+ { "autolock", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_user_flag_edit,
N_("Show/Set whether a user locked out") },
- { "pwnotreq", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_flag_edit,
+ { "pwnotreq", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_user_flag_edit,
N_("Show/Set whether a user does not need a password") },
- { "pwnoexp", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_flag_edit,
+ { "pwnoexp", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_user_flag_edit,
N_("Show/Set whether a user's password does not expire") },
- { NULL, NULL, 0, NULL, NULL }
+ { NULL, NULL, 0, 0, NULL, NULL }
};
return cmds;
@@ -1353,19 +1360,21 @@ struct rpc_sh_cmd *net_rpc_user_cmds(struct net_context *c,
{
static struct rpc_sh_cmd cmds[] = {
- { "list", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_list,
- N_("List available users") },
+ { "list", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
+ rpc_sh_user_list, N_("List available users") },
- { "info", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_info,
+ { "info", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
+ rpc_sh_user_info,
N_("List the domain groups a user is member of") },
- { "show", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_show,
+ { "show", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
+ rpc_sh_user_show,
N_("Show info about a user") },
- { "edit", net_rpc_user_edit_cmds, 0, NULL,
+ { "edit", net_rpc_user_edit_cmds, NULL, 0, NULL,
N_("Show/Modify a user's fields") },
- { NULL, NULL, 0, NULL, NULL }
+ { NULL, NULL, NULL, 0, NULL, NULL }
};
return cmds;
@@ -1607,7 +1616,8 @@ static NTSTATUS rpc_group_delete_internals(struct net_context *c,
static int rpc_group_delete(struct net_context *c, int argc, const char **argv)
{
- return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SAMR_UUID, NDR_SAMR_VERSION, 0,
rpc_group_delete_internals, argc,argv);
}
@@ -1946,7 +1956,8 @@ static NTSTATUS rpc_group_addmem_internals(struct net_context *c,
static int rpc_group_addmem(struct net_context *c, int argc, const char **argv)
{
- return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SAMR_UUID, NDR_SAMR_VERSION, 0,
rpc_group_addmem_internals,
argc, argv);
}
@@ -2148,7 +2159,8 @@ static NTSTATUS rpc_group_delmem_internals(struct net_context *c,
static int rpc_group_delmem(struct net_context *c, int argc, const char **argv)
{
- return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SAMR_UUID, NDR_SAMR_VERSION, 0,
rpc_group_delmem_internals,
argc, argv);
}
@@ -2395,7 +2407,8 @@ static NTSTATUS rpc_group_list_internals(struct net_context *c,
static int rpc_group_list(struct net_context *c, int argc, const char **argv)
{
- return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SAMR_UUID, NDR_SAMR_VERSION, 0,
rpc_group_list_internals,
argc, argv);
}
@@ -2684,7 +2697,8 @@ static int rpc_group_members(struct net_context *c, int argc, const char **argv)
return rpc_group_usage(c, argc, argv);
}
- return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SAMR_UUID, NDR_SAMR_VERSION, 0,
rpc_group_members_internals,
argc, argv);
}
@@ -2818,7 +2832,8 @@ int net_rpc_group(struct net_context *c, int argc, const char **argv)
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SAMR_UUID, NDR_SAMR_VERSION, 0,
rpc_group_list_internals,
argc, argv);
}
@@ -3223,7 +3238,8 @@ static int rpc_share_migrate_shares(struct net_context *c, int argc,
return -1;
}
- return run_rpc_command(c, NULL, &ndr_table_srvsvc.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION, 0,
rpc_share_migrate_shares_internals,
argc, argv);
}
@@ -3556,7 +3572,8 @@ static int rpc_share_migrate_files(struct net_context *c, int argc, const char *
return -1;
}
- return run_rpc_command(c, NULL, &ndr_table_srvsvc.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION, 0,
rpc_share_migrate_files_internals,
argc, argv);
}
@@ -3681,7 +3698,8 @@ static int rpc_share_migrate_security(struct net_context *c, int argc,
return -1;
}
- return run_rpc_command(c, NULL, &ndr_table_srvsvc.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION, 0,
rpc_share_migrate_security_internals,
argc, argv);
}
@@ -3717,17 +3735,20 @@ static int rpc_share_migrate_all(struct net_context *c, int argc,
/* order is important. we don't want to be locked out by the share-acl
* before copying files - gd */
- ret = run_rpc_command(c, NULL, &ndr_table_srvsvc.syntax_id, 0,
+ ret = run_rpc_command(c, NULL,
+ NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION, 0,
rpc_share_migrate_shares_internals, argc, argv);
if (ret)
return ret;
- ret = run_rpc_command(c, NULL, &ndr_table_srvsvc.syntax_id, 0,
+ ret = run_rpc_command(c, NULL,
+ NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION, 0,
rpc_share_migrate_files_internals, argc, argv);
if (ret)
return ret;
- return run_rpc_command(c, NULL, &ndr_table_srvsvc.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION, 0,
rpc_share_migrate_security_internals, argc,
argv);
}
@@ -4511,19 +4532,22 @@ static int rpc_share_allowedusers(struct net_context *c, int argc,
return 0;
}
- result = run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, 0,
+ result = run_rpc_command(c, NULL,
+ NDR_SAMR_UUID, NDR_SAMR_VERSION, 0,
rpc_aliaslist_internals,
argc, argv);
if (result != 0)
return result;
- result = run_rpc_command(c, NULL, &ndr_table_lsarpc.syntax_id, 0,
+ result = run_rpc_command(c, NULL,
+ NDR_LSARPC_UUID, NDR_LSARPC_VERSION, 0,
rpc_aliaslist_dump,
argc, argv);
if (result != 0)
return result;
- return run_rpc_command(c, NULL, &ndr_table_srvsvc.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION, 0,
rpc_share_allowedusers_internals,
argc, argv);
}
@@ -4741,19 +4765,23 @@ struct rpc_sh_cmd *net_rpc_share_cmds(struct net_context *c, TALLOC_CTX *mem_ctx
{
static struct rpc_sh_cmd cmds[] = {
- { "list", NULL, &ndr_table_srvsvc.syntax_id, rpc_sh_share_list,
- N_("List available shares") },
+ { "list", NULL, NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION,
+ rpc_sh_share_list,
+ N_("List available shares") },
- { "add", NULL, &ndr_table_srvsvc.syntax_id, rpc_sh_share_add,
- N_("Add a share") },
+ { "add", NULL, NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION,
+ rpc_sh_share_add,
+ N_("Add a share") },
- { "delete", NULL, &ndr_table_srvsvc.syntax_id, rpc_sh_share_delete,
- N_("Delete a share") },
+ { "delete", NULL, NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION,
+ rpc_sh_share_delete,
+ N_("Delete a share") },
- { "info", NULL, &ndr_table_srvsvc.syntax_id, rpc_sh_share_info,
- N_("Get information about a share") },
+ { "info", NULL, NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION,
+ rpc_sh_share_info,
+ N_("Get information about a share") },
- { NULL, NULL, 0, NULL, NULL }
+ { NULL, NULL, 0, 0, NULL, NULL }
};
return cmds;
@@ -5019,7 +5047,9 @@ static int rpc_shutdown_abort(struct net_context *c, int argc,
return 0;
}
- rc = run_rpc_command(c, NULL, &ndr_table_initshutdown.syntax_id, 0,
+ rc = run_rpc_command(c, NULL,
+ NDR_INITSHUTDOWN_UUID, NDR_INITSHUTDOWN_VERSION,
+ 0,
rpc_shutdown_abort_internals, argc, argv);
if (rc == 0)
@@ -5027,7 +5057,8 @@ static int rpc_shutdown_abort(struct net_context *c, int argc,
DEBUG(1, ("initshutdown pipe didn't work, trying winreg pipe\n"));
- return run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_WINREG_UUID, NDR_WINREG_VERSION, 0,
rpc_reg_shutdown_abort_internals,
argc, argv);
}
@@ -5166,12 +5197,14 @@ static int rpc_shutdown(struct net_context *c, int argc, const char **argv)
return 0;
}
- rc = run_rpc_command(c, NULL, &ndr_table_initshutdown.syntax_id, 0,
- rpc_init_shutdown_internals, argc, argv);
+ rc = run_rpc_command(c, NULL,
+ NDR_INITSHUTDOWN_UUID, NDR_INITSHUTDOWN_VERSION,
+ 0, rpc_init_shutdown_internals, argc, argv);
if (rc) {
DEBUG(1, ("initshutdown pipe failed, trying winreg pipe\n"));
- rc = run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 0,
+ rc = run_rpc_command(c, NULL,
+ NDR_WINREG_UUID, NDR_WINREG_VERSION, 0,
rpc_reg_shutdown_internals, argc, argv);
}
@@ -5329,7 +5362,8 @@ static NTSTATUS rpc_trustdom_add_internals(struct net_context *c,
static int rpc_trustdom_add(struct net_context *c, int argc, const char **argv)
{
if (argc > 0 && !c->display_usage) {
- return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SAMR_UUID, NDR_SAMR_VERSION, 0,
rpc_trustdom_add_internals, argc, argv);
} else {
d_printf(_("Usage:\n"
@@ -5487,7 +5521,8 @@ static NTSTATUS rpc_trustdom_del_internals(struct net_context *c,
static int rpc_trustdom_del(struct net_context *c, int argc, const char **argv)
{
if (argc > 0 && !c->display_usage) {
- return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SAMR_UUID, NDR_SAMR_VERSION, 0,
rpc_trustdom_del_internals, argc, argv);
} else {
d_printf(_("Usage:\n"
@@ -6239,7 +6274,8 @@ static int rpc_trustdom_list(struct net_context *c, int argc, const char **argv)
/* query for domain's sid */
if (run_rpc_command(
c, remote_cli,
- &ndr_table_lsarpc.syntax_id, 0,
+ NDR_LSARPC_UUID,
+ NDR_LSARPC_VERSION, 0,
rpc_query_domain_sid, argc,
argv))
d_printf(_("strange - couldn't get domain's sid\n"));
@@ -6391,7 +6427,8 @@ static int rpc_samdump(struct net_context *c, int argc, const char **argv) {
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_netlogon.syntax_id,
+ return run_rpc_command(c, NULL,
+ NDR_NETLOGON_UUID, NDR_NETLOGON_VERSION,
NET_FLAGS_ANONYMOUS,
rpc_samdump_internals, argc, argv);
}
@@ -6438,7 +6475,8 @@ static int rpc_vampire(struct net_context *c, int argc, const char **argv)
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_netlogon.syntax_id,
+ return run_rpc_command(c, NULL,
+ NDR_NETLOGON_UUID, NDR_NETLOGON_VERSION,
NET_FLAGS_ANONYMOUS,
rpc_vampire_internals,
argc, argv);
@@ -6479,30 +6517,35 @@ static int rpc_printer_migrate_all(struct net_context *c, int argc,
return -1;
}
- ret = run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
+ ret = run_rpc_command(c, NULL,
+ NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
rpc_printer_migrate_printers_internals, argc,
argv);
if (ret)
return ret;
- ret = run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
+ ret = run_rpc_command(c, NULL,
+ NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
rpc_printer_migrate_drivers_internals, argc,
argv);
if (ret)
return ret;
- ret = run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
+ ret = run_rpc_command(c, NULL,
+ NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
rpc_printer_migrate_forms_internals, argc, argv);
if (ret)
return ret;
- ret = run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
+ ret = run_rpc_command(c, NULL,
+ NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
rpc_printer_migrate_settings_internals, argc,
argv);
if (ret)
return ret;
- return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
rpc_printer_migrate_security_internals, argc,
argv);
@@ -6533,7 +6576,8 @@ static int rpc_printer_migrate_drivers(struct net_context *c, int argc,
return -1;
}
- return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
rpc_printer_migrate_drivers_internals,
argc, argv);
}
@@ -6563,7 +6607,8 @@ static int rpc_printer_migrate_forms(struct net_context *c, int argc,
return -1;
}
- return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
rpc_printer_migrate_forms_internals,
argc, argv);
}
@@ -6593,7 +6638,8 @@ static int rpc_printer_migrate_printers(struct net_context *c, int argc,
return -1;
}
- return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
rpc_printer_migrate_printers_internals,
argc, argv);
}
@@ -6623,7 +6669,8 @@ static int rpc_printer_migrate_security(struct net_context *c, int argc,
return -1;
}
- return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
rpc_printer_migrate_security_internals,
argc, argv);
}
@@ -6654,7 +6701,8 @@ static int rpc_printer_migrate_settings(struct net_context *c, int argc,
return -1;
}
- return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
rpc_printer_migrate_settings_internals,
argc, argv);
}
@@ -6750,7 +6798,8 @@ static int rpc_printer_list(struct net_context *c, int argc, const char **argv)
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
rpc_printer_list_internals,
argc, argv);
}
@@ -6775,8 +6824,8 @@ static int rpc_printer_driver_list(struct net_context *c, int argc,
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
- rpc_printer_driver_list_internals,
+ return run_rpc_command(c, NULL, NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION,
+ 0, rpc_printer_driver_list_internals,
argc, argv);
}
@@ -6800,8 +6849,8 @@ static int rpc_printer_publish_publish(struct net_context *c, int argc,
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
- rpc_printer_publish_publish_internals,
+ return run_rpc_command(c, NULL, NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION,
+ 0, rpc_printer_publish_publish_internals,
argc, argv);
}
@@ -6824,7 +6873,8 @@ static int rpc_printer_publish_update(struct net_context *c, int argc, const cha
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
rpc_printer_publish_update_internals,
argc, argv);
}
@@ -6849,7 +6899,8 @@ static int rpc_printer_publish_unpublish(struct net_context *c, int argc,
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
rpc_printer_publish_unpublish_internals,
argc, argv);
}
@@ -6874,7 +6925,8 @@ static int rpc_printer_publish_list(struct net_context *c, int argc,
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
rpc_printer_publish_list_internals,
argc, argv);
}
@@ -6940,9 +6992,10 @@ static int rpc_printer_publish(struct net_context *c, int argc,
net_display_usage_from_functable(func);
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
- rpc_printer_publish_list_internals,
- argc, argv);
+ return run_rpc_command(c, NULL,
+ NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION,
+ 0, rpc_printer_publish_list_internals,
+ argc, argv);
}
return net_run_function(c, argc, argv, "net rpc printer publish",func);
@@ -7043,9 +7096,10 @@ int net_rpc_printer(struct net_context *c, int argc, const char **argv)
net_display_usage_from_functable(func);
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
- rpc_printer_list_internals,
- argc, argv);
+ return run_rpc_command(c, NULL,
+ NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION,
+ 0, rpc_printer_list_internals,
+ argc, argv);
}
return net_run_function(c, argc, argv, "net rpc printer", func);
diff --git a/source3/utils/net_rpc_audit.c b/source3/utils/net_rpc_audit.c
index bc3ed3dba2..4c79f027f4 100644
--- a/source3/utils/net_rpc_audit.c
+++ b/source3/utils/net_rpc_audit.c
@@ -369,8 +369,8 @@ static int rpc_audit_get(struct net_context *c, int argc, const char **argv)
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_lsarpc.syntax_id, 0,
- rpc_audit_get_internal, argc, argv);
+ return run_rpc_command(c, NULL, NDR_LSARPC_UUID, NDR_LSARPC_VERSION, 0,
+ rpc_audit_get_internal, argc, argv);
}
/********************************************************************
@@ -385,8 +385,8 @@ static int rpc_audit_set(struct net_context *c, int argc, const char **argv)
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_lsarpc.syntax_id, 0,
- rpc_audit_set_internal, argc, argv);
+ return run_rpc_command(c, NULL, NDR_LSARPC_UUID, NDR_LSARPC_VERSION, 0,
+ rpc_audit_set_internal, argc, argv);
}
/********************************************************************
@@ -401,8 +401,8 @@ static int rpc_audit_enable(struct net_context *c, int argc, const char **argv)
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_lsarpc.syntax_id, 0,
- rpc_audit_enable_internal, argc, argv);
+ return run_rpc_command(c, NULL, NDR_LSARPC_UUID, NDR_LSARPC_VERSION, 0,
+ rpc_audit_enable_internal, argc, argv);
}
/********************************************************************
@@ -417,8 +417,8 @@ static int rpc_audit_disable(struct net_context *c, int argc, const char **argv)
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_lsarpc.syntax_id, 0,
- rpc_audit_disable_internal, argc, argv);
+ return run_rpc_command(c, NULL, NDR_LSARPC_UUID, NDR_LSARPC_VERSION, 0,
+ rpc_audit_disable_internal, argc, argv);
}
/********************************************************************
@@ -433,8 +433,8 @@ static int rpc_audit_list(struct net_context *c, int argc, const char **argv)
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_lsarpc.syntax_id, 0,
- rpc_audit_list_internal, argc, argv);
+ return run_rpc_command(c, NULL, NDR_LSARPC_UUID, NDR_LSARPC_VERSION, 0,
+ rpc_audit_list_internal, argc, argv);
}
/********************************************************************
diff --git a/source3/utils/net_rpc_registry.c b/source3/utils/net_rpc_registry.c
index 36e83a75af..0f0eac94d4 100644
--- a/source3/utils/net_rpc_registry.c
+++ b/source3/utils/net_rpc_registry.c
@@ -475,8 +475,8 @@ static int rpc_registry_setvalue(struct net_context *c, int argc,
return -1;
}
- return run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 0,
- rpc_registry_setvalue_internal, argc, argv );
+ return run_rpc_command(c, NULL, NDR_WINREG_UUID, NDR_WINREG_VERSION, 0,
+ rpc_registry_setvalue_internal, argc, argv );
}
static NTSTATUS rpc_registry_deletevalue_internal(struct net_context *c,
@@ -528,8 +528,8 @@ static int rpc_registry_deletevalue(struct net_context *c, int argc,
return -1;
}
- return run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 0,
- rpc_registry_deletevalue_internal, argc, argv );
+ return run_rpc_command(c, NULL, NDR_WINREG_UUID, NDR_WINREG_VERSION, 0,
+ rpc_registry_deletevalue_internal, argc, argv );
}
static NTSTATUS rpc_registry_getvalue_internal(struct net_context *c,
@@ -643,8 +643,8 @@ static int rpc_registry_getvalue(struct net_context *c, int argc,
return -1;
}
- return run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 0,
- rpc_registry_getvalue_full, argc, argv);
+ return run_rpc_command(c, NULL, NDR_WINREG_UUID, NDR_WINREG_VERSION, 0,
+ rpc_registry_getvalue_full, argc, argv);
}
static NTSTATUS rpc_registry_getvalue_raw(struct net_context *c,
@@ -670,8 +670,8 @@ static int rpc_registry_getvalueraw(struct net_context *c, int argc,
return -1;
}
- return run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 0,
- rpc_registry_getvalue_raw, argc, argv);
+ return run_rpc_command(c, NULL, NDR_WINREG_UUID, NDR_WINREG_VERSION, 0,
+ rpc_registry_getvalue_raw, argc, argv);
}
static NTSTATUS rpc_registry_createkey_internal(struct net_context *c,
@@ -743,8 +743,8 @@ static int rpc_registry_createkey(struct net_context *c, int argc,
return -1;
}
- return run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 0,
- rpc_registry_createkey_internal, argc, argv );
+ return run_rpc_command(c, NULL, NDR_WINREG_UUID, NDR_WINREG_VERSION, 0,
+ rpc_registry_createkey_internal, argc, argv );
}
static NTSTATUS rpc_registry_deletekey_internal(struct net_context *c,
@@ -793,8 +793,8 @@ static int rpc_registry_deletekey(struct net_context *c, int argc, const char **
return -1;
}
- return run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 0,
- rpc_registry_deletekey_internal, argc, argv );
+ return run_rpc_command(c, NULL, NDR_WINREG_UUID, NDR_WINREG_VERSION, 0,
+ rpc_registry_deletekey_internal, argc, argv );
}
/********************************************************************
@@ -869,8 +869,8 @@ static NTSTATUS rpc_registry_enumerate_internal(struct net_context *c,
static int rpc_registry_enumerate(struct net_context *c, int argc,
const char **argv )
{
- return run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 0,
- rpc_registry_enumerate_internal, argc, argv );
+ return run_rpc_command(c, NULL, NDR_WINREG_UUID, NDR_WINREG_VERSION, 0,
+ rpc_registry_enumerate_internal, argc, argv );
}
/********************************************************************
@@ -924,8 +924,8 @@ static NTSTATUS rpc_registry_save_internal(struct net_context *c,
static int rpc_registry_save(struct net_context *c, int argc, const char **argv )
{
- return run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 0,
- rpc_registry_save_internal, argc, argv );
+ return run_rpc_command(c, NULL, NDR_WINREG_UUID, NDR_WINREG_VERSION, 0,
+ rpc_registry_save_internal, argc, argv );
}
@@ -1255,8 +1255,8 @@ static NTSTATUS rpc_registry_getsd_internal(struct net_context *c,
static int rpc_registry_getsd(struct net_context *c, int argc, const char **argv)
{
- return run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 0,
- rpc_registry_getsd_internal, argc, argv);
+ return run_rpc_command(c, NULL, NDR_WINREG_UUID, NDR_WINREG_VERSION, 0,
+ rpc_registry_getsd_internal, argc, argv);
}
/********************************************************************
diff --git a/source3/utils/net_rpc_rights.c b/source3/utils/net_rpc_rights.c
index defed47914..b83a513443 100644
--- a/source3/utils/net_rpc_rights.c
+++ b/source3/utils/net_rpc_rights.c
@@ -583,8 +583,8 @@ static int rpc_rights_list(struct net_context *c, int argc, const char **argv )
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_lsarpc.syntax_id, 0,
- rpc_rights_list_internal, argc, argv );
+ return run_rpc_command(c, NULL, NDR_LSARPC_UUID, NDR_LSARPC_VERSION, 0,
+ rpc_rights_list_internal, argc, argv );
}
/********************************************************************
@@ -604,8 +604,8 @@ static int rpc_rights_grant(struct net_context *c, int argc, const char **argv )
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_lsarpc.syntax_id, 0,
- rpc_rights_grant_internal, argc, argv );
+ return run_rpc_command(c, NULL, NDR_LSARPC_UUID, NDR_LSARPC_VERSION, 0,
+ rpc_rights_grant_internal, argc, argv );
}
/********************************************************************
@@ -625,8 +625,8 @@ static int rpc_rights_revoke(struct net_context *c, int argc, const char **argv)
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_lsarpc.syntax_id, 0,
- rpc_rights_revoke_internal, argc, argv );
+ return run_rpc_command(c, NULL, NDR_LSARPC_UUID, NDR_LSARPC_VERSION, 0,
+ rpc_rights_revoke_internal, argc, argv );
}
/********************************************************************
@@ -702,16 +702,19 @@ struct rpc_sh_cmd *net_rpc_rights_cmds(struct net_context *c, TALLOC_CTX *mem_ct
{
static struct rpc_sh_cmd cmds[] = {
- { "list", NULL, &ndr_table_lsarpc.syntax_id, rpc_sh_rights_list,
- N_("View available or assigned privileges") },
+ { "list", NULL, NDR_LSARPC_UUID, NDR_LSARPC_VERSION,
+ rpc_sh_rights_list,
+ N_("View available or assigned privileges") },
- { "grant", NULL, &ndr_table_lsarpc.syntax_id, rpc_sh_rights_grant,
- N_("Assign privilege[s]") },
+ { "grant", NULL, NDR_LSARPC_UUID, NDR_LSARPC_VERSION,
+ rpc_sh_rights_grant,
+ N_("Assign privilege[s]") },
- { "revoke", NULL, &ndr_table_lsarpc.syntax_id, rpc_sh_rights_revoke,
- N_("Revoke privilege[s]") },
+ { "revoke", NULL, NDR_LSARPC_UUID, NDR_LSARPC_VERSION,
+ rpc_sh_rights_revoke,
+ N_("Revoke privilege[s]") },
- { NULL, NULL, 0, NULL, NULL }
+ { NULL, NULL, 0, 0, NULL, NULL }
};
return cmds;
diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c
index 89568eef94..370c075f2c 100644
--- a/source3/utils/net_rpc_samsync.c
+++ b/source3/utils/net_rpc_samsync.c
@@ -258,7 +258,8 @@ int rpc_vampire_passdb(struct net_context *c, int argc, const char **argv)
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_netlogon.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_NETLOGON_UUID, NDR_NETLOGON_VERSION, 0,
rpc_vampire_internals, argc, argv);
}
@@ -340,7 +341,8 @@ int rpc_vampire_ldif(struct net_context *c, int argc, const char **argv)
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_netlogon.syntax_id, 0,
+ return run_rpc_command(c, NULL,
+ NDR_NETLOGON_UUID, NDR_NETLOGON_VERSION, 0,
rpc_vampire_ldif_internals, argc, argv);
}
@@ -496,20 +498,25 @@ int rpc_vampire_keytab(struct net_context *c, int argc, const char **argv)
if (!dc_info.is_ad) {
printf(_("DC is not running Active Directory\n"));
- ret = run_rpc_command(c, cli, &ndr_table_netlogon.syntax_id,
- 0,
- rpc_vampire_keytab_internals, argc, argv);
+ ret = run_rpc_command(c, cli,
+ NDR_NETLOGON_UUID, NDR_NETLOGON_VERSION,
+ 0, rpc_vampire_keytab_internals,
+ argc, argv);
return -1;
} else {
- ret = run_rpc_command(c, cli, &ndr_table_drsuapi.syntax_id,
+ ret = run_rpc_command(c, cli,
+ NDR_DRSUAPI_UUID, NDR_DRSUAPI_VERSION,
NET_FLAGS_SEAL | NET_FLAGS_TCP,
rpc_vampire_keytab_ds_internals, argc, argv);
if (ret != 0 && dc_info.is_mixed_mode) {
printf(_("Fallback to NT4 vampire on Mixed-Mode AD "
"Domain\n"));
- ret = run_rpc_command(c, cli, &ndr_table_netlogon.syntax_id,
+ ret = run_rpc_command(c, cli,
+ NDR_NETLOGON_UUID,
+ NDR_NETLOGON_VERSION,
0,
- rpc_vampire_keytab_internals, argc, argv);
+ rpc_vampire_keytab_internals,
+ argc, argv);
}
}
diff --git a/source3/utils/net_rpc_service.c b/source3/utils/net_rpc_service.c
index 1ef7c3ed09..c447b1d889 100644
--- a/source3/utils/net_rpc_service.c
+++ b/source3/utils/net_rpc_service.c
@@ -827,8 +827,8 @@ static int rpc_service_list(struct net_context *c, int argc, const char **argv )
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_svcctl.syntax_id, 0,
- rpc_service_list_internal, argc, argv );
+ return run_rpc_command(c, NULL, NDR_SVCCTL_UUID, NDR_SVCCTL_VERSION, 0,
+ rpc_service_list_internal, argc, argv );
}
/********************************************************************
@@ -843,8 +843,8 @@ static int rpc_service_start(struct net_context *c, int argc, const char **argv
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_svcctl.syntax_id, 0,
- rpc_service_start_internal, argc, argv );
+ return run_rpc_command(c, NULL, NDR_SVCCTL_UUID, NDR_SVCCTL_VERSION, 0,
+ rpc_service_start_internal, argc, argv );
}
/********************************************************************
@@ -859,8 +859,8 @@ static int rpc_service_stop(struct net_context *c, int argc, const char **argv )
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_svcctl.syntax_id, 0,
- rpc_service_stop_internal, argc, argv );
+ return run_rpc_command(c, NULL, NDR_SVCCTL_UUID, NDR_SVCCTL_VERSION, 0,
+ rpc_service_stop_internal, argc, argv );
}
/********************************************************************
@@ -875,8 +875,8 @@ static int rpc_service_resume(struct net_context *c, int argc, const char **argv
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_svcctl.syntax_id, 0,
- rpc_service_resume_internal, argc, argv );
+ return run_rpc_command(c, NULL, NDR_SVCCTL_UUID, NDR_SVCCTL_VERSION, 0,
+ rpc_service_resume_internal, argc, argv );
}
/********************************************************************
@@ -891,8 +891,8 @@ static int rpc_service_pause(struct net_context *c, int argc, const char **argv
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_svcctl.syntax_id, 0,
- rpc_service_pause_internal, argc, argv );
+ return run_rpc_command(c, NULL, NDR_SVCCTL_UUID, NDR_SVCCTL_VERSION, 0,
+ rpc_service_pause_internal, argc, argv );
}
/********************************************************************
@@ -907,8 +907,8 @@ static int rpc_service_status(struct net_context *c, int argc, const char **argv
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_svcctl.syntax_id, 0,
- rpc_service_status_internal, argc, argv );
+ return run_rpc_command(c, NULL, NDR_SVCCTL_UUID, NDR_SVCCTL_VERSION, 0,
+ rpc_service_status_internal, argc, argv );
}
/********************************************************************
@@ -923,8 +923,8 @@ static int rpc_service_delete(struct net_context *c, int argc, const char **argv
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_svcctl.syntax_id, 0,
- rpc_service_delete_internal, argc, argv);
+ return run_rpc_command(c, NULL, NDR_SVCCTL_UUID, NDR_SVCCTL_VERSION, 0,
+ rpc_service_delete_internal, argc, argv);
}
/********************************************************************
@@ -939,8 +939,8 @@ static int rpc_service_create(struct net_context *c, int argc, const char **argv
return 0;
}
- return run_rpc_command(c, NULL, &ndr_table_svcctl.syntax_id, 0,
- rpc_service_create_internal, argc, argv);
+ return run_rpc_command(c, NULL, NDR_SVCCTL_UUID, NDR_SVCCTL_VERSION, 0,
+ rpc_service_create_internal, argc, argv);
}
/********************************************************************
diff --git a/source3/utils/net_rpc_sh_acct.c b/source3/utils/net_rpc_sh_acct.c
index 83ce3551d1..9b788a4715 100644
--- a/source3/utils/net_rpc_sh_acct.c
+++ b/source3/utils/net_rpc_sh_acct.c
@@ -430,24 +430,31 @@ struct rpc_sh_cmd *net_rpc_acct_cmds(struct net_context *c, TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx)
{
static struct rpc_sh_cmd cmds[9] = {
- { "show", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_pol_show,
+ { "show", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
+ rpc_sh_acct_pol_show,
N_("Show current account policy settings") },
- { "badpw", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_set_badpw,
+ { "badpw", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
+ rpc_sh_acct_set_badpw,
N_("Set bad password count before lockout") },
- { "lockduration", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_set_lockduration,
+ { "lockduration", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
+ rpc_sh_acct_set_lockduration,
N_("Set account lockout duration") },
- { "resetduration", NULL, &ndr_table_samr.syntax_id,
+ { "resetduration", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
rpc_sh_acct_set_resetduration,
N_("Set bad password count reset duration") },
- { "minpwage", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_set_minpwage,
+ { "minpwage", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
+ rpc_sh_acct_set_minpwage,
N_("Set minimum password age") },
- { "maxpwage", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_set_maxpwage,
+ { "maxpwage", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
+ rpc_sh_acct_set_maxpwage,
N_("Set maximum password age") },
- { "minpwlen", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_set_minpwlen,
+ { "minpwlen", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
+ rpc_sh_acct_set_minpwlen,
N_("Set minimum password length") },
- { "pwhistlen", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_set_pwhistlen,
+ { "pwhistlen", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
+ rpc_sh_acct_set_pwhistlen,
N_("Set the password history length") },
- { NULL, NULL, 0, NULL, NULL }
+ { NULL, NULL, NULL, 0, NULL, NULL }
};
return cmds;
diff --git a/source3/utils/net_rpc_shell.c b/source3/utils/net_rpc_shell.c
index 5e0f150371..5b94fac145 100644
--- a/source3/utils/net_rpc_shell.c
+++ b/source3/utils/net_rpc_shell.c
@@ -70,16 +70,21 @@ static NTSTATUS net_sh_run(struct net_context *c,
{
TALLOC_CTX *mem_ctx;
struct rpc_pipe_client *pipe_hnd;
+ struct ndr_syntax_id syntax;
NTSTATUS status;
+ if (!ndr_syntax_from_string(cmd->interface, cmd->interface_version,
+ &syntax)) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
mem_ctx = talloc_new(ctx);
if (mem_ctx == NULL) {
d_fprintf(stderr, _("talloc_new failed\n"));
return NT_STATUS_NO_MEMORY;
}
- status = cli_rpc_pipe_open_noauth(ctx->cli, cmd->interface,
- &pipe_hnd);
+ status = cli_rpc_pipe_open_noauth(ctx->cli, &syntax, &pipe_hnd);
if (!NT_STATUS_IS_OK(status)) {
d_fprintf(stderr, _("Could not open pipe: %s\n"),
nt_errstr(status));
@@ -190,22 +195,22 @@ static bool net_sh_process(struct net_context *c,
static struct rpc_sh_cmd sh_cmds[6] = {
- { "info", NULL, &ndr_table_samr.syntax_id, rpc_sh_info,
+ { "info", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_info,
N_("Print information about the domain connected to") },
- { "rights", net_rpc_rights_cmds, 0, NULL,
+ { "rights", net_rpc_rights_cmds, NULL, 0, NULL,
N_("List/Grant/Revoke user rights") },
- { "share", net_rpc_share_cmds, 0, NULL,
+ { "share", net_rpc_share_cmds, NULL, 0, NULL,
N_("List/Add/Remove etc shares") },
- { "user", net_rpc_user_cmds, 0, NULL,
+ { "user", net_rpc_user_cmds, NULL, 0, NULL,
N_("List/Add/Remove user info") },
- { "account", net_rpc_acct_cmds, 0, NULL,
+ { "account", net_rpc_acct_cmds, NULL, 0, NULL,
N_("Show/Change account policy settings") },
- { NULL, NULL, 0, NULL, NULL }
+ { NULL, NULL, NULL, 0, NULL, NULL }
};
int net_rpc_shell(struct net_context *c, int argc, const char **argv)