Revert "s3: Make run_rpc_command take strings instead of a ndr_interface_table"
authorVolker Lendecke <vl@samba.org>
Sun, 8 Nov 2009 18:37:26 +0000 (19:37 +0100)
committerVolker Lendecke <vl@samba.org>
Sun, 8 Nov 2009 18:43:46 +0000 (19:43 +0100)
This reverts commit 53f2a1595e76db9fe1b42db65b51895b73365993.

source3/utils/net.h
source3/utils/net_dom.c
source3/utils/net_proto.h
source3/utils/net_rpc.c
source3/utils/net_rpc_audit.c
source3/utils/net_rpc_registry.c
source3/utils/net_rpc_rights.c
source3/utils/net_rpc_samsync.c
source3/utils/net_rpc_service.c
source3/utils/net_rpc_sh_acct.c
source3/utils/net_rpc_shell.c

index ee06ded8d1b09e9184c40d260c393261aa7e5b3a..765b61bd564d118fa4d0e7bc34c139ff241fdac3 100644 (file)
@@ -142,8 +142,7 @@ struct rpc_sh_cmd {
        struct rpc_sh_cmd *(*sub)(struct net_context *c,
                                  TALLOC_CTX *mem_ctx,
                                  struct rpc_sh_ctx *ctx);
-       const char *interface;
-       uint32_t interface_version;
+       const struct ndr_syntax_id *interface;
        NTSTATUS (*fn)(struct net_context *c, TALLOC_CTX *mem_ctx,
                       struct rpc_sh_ctx *ctx,
                       struct rpc_pipe_client *pipe_hnd,
index 57d616b42cf73990f4c3c79f274617b9ee1291fa..433fb6c671c452d6b022674da47288c36f0c1b20 100644 (file)
@@ -100,16 +100,14 @@ 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_INITSHUTDOWN_UUID,
-                                     NDR_INITSHUTDOWN_VERSION,
+                                     &ndr_table_initshutdown.syntax_id,
                                      0, rpc_init_shutdown_internals,
                                      argc, argv);
                if (ret == 0) {
                        goto done;
                }
 
-               ret = run_rpc_command(c, cli,
-                                     NDR_WINREG_UUID, NDR_WINREG_VERSION, 0,
+               ret = run_rpc_command(c, cli, &ndr_table_winreg.syntax_id, 0,
                                      rpc_reg_shutdown_internals,
                                      argc, argv);
                goto done;
@@ -208,17 +206,14 @@ 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_INITSHUTDOWN_UUID,
-                                     NDR_INITSHUTDOWN_VERSION, 0,
+               ret = run_rpc_command(c, cli, &ndr_table_initshutdown.syntax_id, 0,
                                      rpc_init_shutdown_internals,
                                      argc, argv);
                if (ret == 0) {
                        goto done;
                }
 
-               ret = run_rpc_command(c, cli,
-                                     NDR_WINREG_UUID, NDR_WINREG_VERSION, 0,
+               ret = run_rpc_command(c, cli, &ndr_table_winreg.syntax_id, 0,
                                      rpc_reg_shutdown_internals,
                                      argc, argv);
                goto done;
@@ -308,16 +303,14 @@ static int net_dom_renamecomputer(struct net_context *c, int argc, const char **
                c->opt_timeout = 30;
 
                ret = run_rpc_command(c, cli,
-                                     NDR_INITSHUTDOWN_UUID,
-                                     NDR_INITSHUTDOWN_VERSION,
+                                     &ndr_table_initshutdown.syntax_id,
                                      0, rpc_init_shutdown_internals,
                                      argc, argv);
                if (ret == 0) {
                        goto done;
                }
 
-               ret = run_rpc_command(c, cli,
-                                     NDR_WINREG_UUID, NDR_WINREG_VERSION, 0,
+               ret = run_rpc_command(c, cli, &ndr_table_winreg.syntax_id, 0,
                                      rpc_reg_shutdown_internals,
                                      argc, argv);
                goto done;
index 92cd7a67375c35cd0d76285ddafb737e72ef4bb5..098e2a22be6b486db68ed0f891258dc900664b71 100644 (file)
@@ -158,8 +158,7 @@ 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 char *interface,
-                       uint32_t interface_version,
+                       const struct ndr_syntax_id *interface,
                        int conn_flags,
                        rpc_command_fn fn,
                        int argc,
index d50a1f5313a3a0edc2ef7af01f92eb00f32db247..4ef86d171bf1ab2f31d909485d6e702afbeadfe4 100644 (file)
@@ -109,8 +109,7 @@ 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 char *interface,
-                       uint32_t interface_version,
+                       const struct ndr_syntax_id *interface,
                        int conn_flags,
                        rpc_command_fn fn,
                        int argc,
@@ -118,7 +117,6 @@ 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;
@@ -141,10 +139,6 @@ 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"))) {
@@ -160,11 +154,11 @@ int run_rpc_command(struct net_context *c,
 
        if (!(conn_flags & NET_FLAGS_NO_PIPE)) {
                if (lp_client_schannel()
-                   && (ndr_syntax_id_equal(&syntax,
+                   && (ndr_syntax_id_equal(interface,
                                            &ndr_table_netlogon.syntax_id))) {
                        /* Always try and create an schannel netlogon pipe. */
                        nt_status = cli_rpc_pipe_open_schannel(
-                               cli, &syntax, NCACN_NP,
+                               cli, interface, NCACN_NP,
                                DCERPC_AUTH_LEVEL_PRIVACY, domain_name,
                                &pipe_hnd);
                        if (!NT_STATUS_IS_OK(nt_status)) {
@@ -175,7 +169,7 @@ int run_rpc_command(struct net_context *c,
                } else {
                        if (conn_flags & NET_FLAGS_SEAL) {
                                nt_status = cli_rpc_pipe_open_ntlmssp(
-                                       cli, &syntax,
+                                       cli, interface,
                                        (conn_flags & NET_FLAGS_TCP) ?
                                        NCACN_IP_TCP : NCACN_NP,
                                        DCERPC_AUTH_LEVEL_PRIVACY,
@@ -183,12 +177,13 @@ int run_rpc_command(struct net_context *c,
                                        c->opt_password, &pipe_hnd);
                        } else {
                                nt_status = cli_rpc_pipe_open_noauth(
-                                       cli, &syntax, &pipe_hnd);
+                                       cli, interface,
+                                       &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(), &syntax),
+                                                 talloc_tos(), interface),
                                        nt_errstr(nt_status) ));
                                goto fail;
                        }
@@ -276,8 +271,7 @@ int net_rpc_changetrustpw(struct net_context *c, int argc, const char **argv)
                return 0;
        }
 
-       return run_rpc_command(c, NULL, NDR_NETLOGON_UUID,
-                              NDR_NETLOGON_VERSION,
+       return run_rpc_command(c, NULL, &ndr_table_netlogon.syntax_id,
                               NET_FLAGS_ANONYMOUS | NET_FLAGS_PDC,
                               rpc_changetrustpw_internals,
                               argc, argv);
@@ -379,8 +373,7 @@ 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_NETLOGON_UUID, NDR_NETLOGON_VERSION,
+       return run_rpc_command(c, NULL, &ndr_table_netlogon.syntax_id,
                               NET_FLAGS_NO_PIPE | NET_FLAGS_ANONYMOUS | NET_FLAGS_PDC,
                               rpc_oldjoin_internals,
                               argc, argv);
@@ -554,7 +547,7 @@ int net_rpc_info(struct net_context *c, int argc, const char **argv)
                return 0;
        }
 
-       return run_rpc_command(c, NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
+       return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id,
                               NET_FLAGS_PDC, rpc_info_internals,
                               argc, argv);
 }
@@ -614,7 +607,7 @@ int net_rpc_getsid(struct net_context *c, int argc, const char **argv)
                return 0;
        }
 
-       return run_rpc_command(c, NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
+       return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id,
                               NET_FLAGS_ANONYMOUS | NET_FLAGS_PDC,
                               rpc_getsid_internals,
                               argc, argv);
@@ -1318,37 +1311,37 @@ struct rpc_sh_cmd *net_rpc_user_edit_cmds(struct net_context *c,
 {
        static struct rpc_sh_cmd cmds[] = {
 
-               { "fullname", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_user_str_edit,
+               { "fullname", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_str_edit,
                  N_("Show/Set a user's full name") },
 
-               { "homedir", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_user_str_edit,
+               { "homedir", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_str_edit,
                  N_("Show/Set a user's home directory") },
 
-               { "homedrive", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_user_str_edit,
+               { "homedrive", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_str_edit,
                  N_("Show/Set a user's home drive") },
 
-               { "logonscript", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_user_str_edit,
+               { "logonscript", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_str_edit,
                  N_("Show/Set a user's logon script") },
 
-               { "profilepath", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_user_str_edit,
+               { "profilepath", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_str_edit,
                  N_("Show/Set a user's profile path") },
 
-               { "description", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_user_str_edit,
+               { "description", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_str_edit,
                  N_("Show/Set a user's description") },
 
-               { "disabled", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_user_flag_edit,
+               { "disabled", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_flag_edit,
                  N_("Show/Set whether a user is disabled") },
 
-               { "autolock", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_user_flag_edit,
+               { "autolock", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_flag_edit,
                  N_("Show/Set whether a user locked out") },
 
-               { "pwnotreq", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_user_flag_edit,
+               { "pwnotreq", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_flag_edit,
                  N_("Show/Set whether a user does not need a password") },
 
-               { "pwnoexp", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_user_flag_edit,
+               { "pwnoexp", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_flag_edit,
                  N_("Show/Set whether a user's password does not expire") },
 
-               { NULL, NULL, 0, 0, NULL, NULL }
+               { NULL, NULL, 0, NULL, NULL }
        };
 
        return cmds;
@@ -1360,21 +1353,19 @@ struct rpc_sh_cmd *net_rpc_user_cmds(struct net_context *c,
 {
        static struct rpc_sh_cmd cmds[] = {
 
-               { "list", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
-                 rpc_sh_user_list, N_("List available users") },
+               { "list", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_list,
+                 N_("List available users") },
 
-               { "info", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
-                 rpc_sh_user_info,
+               { "info", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_info,
                  N_("List the domain groups a user is member of") },
 
-               { "show", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
-                 rpc_sh_user_show,
+               { "show", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_show,
                  N_("Show info about a user") },
 
-               { "edit", net_rpc_user_edit_cmds, NULL, 0, NULL,
+               { "edit", net_rpc_user_edit_cmds, 0, NULL,
                  N_("Show/Modify a user's fields") },
 
-               { NULL, NULL, NULL, 0, NULL, NULL }
+               { NULL, NULL, 0, NULL, NULL }
        };
 
        return cmds;
@@ -1616,8 +1607,7 @@ 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_SAMR_UUID, NDR_SAMR_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, 0,
                               rpc_group_delete_internals, argc,argv);
 }
 
@@ -1956,8 +1946,7 @@ 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_SAMR_UUID, NDR_SAMR_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, 0,
                               rpc_group_addmem_internals,
                               argc, argv);
 }
@@ -2159,8 +2148,7 @@ 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_SAMR_UUID, NDR_SAMR_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, 0,
                               rpc_group_delmem_internals,
                               argc, argv);
 }
@@ -2407,8 +2395,7 @@ 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_SAMR_UUID, NDR_SAMR_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, 0,
                               rpc_group_list_internals,
                               argc, argv);
 }
@@ -2697,8 +2684,7 @@ 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_SAMR_UUID, NDR_SAMR_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, 0,
                               rpc_group_members_internals,
                               argc, argv);
 }
@@ -2832,8 +2818,7 @@ int net_rpc_group(struct net_context *c, int argc, const char **argv)
                        return 0;
                }
 
-               return run_rpc_command(c, NULL,
-                                      NDR_SAMR_UUID, NDR_SAMR_VERSION, 0,
+               return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, 0,
                                       rpc_group_list_internals,
                                       argc, argv);
        }
@@ -3238,8 +3223,7 @@ static int rpc_share_migrate_shares(struct net_context *c, int argc,
                return -1;
        }
 
-       return run_rpc_command(c, NULL,
-                              NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_srvsvc.syntax_id, 0,
                               rpc_share_migrate_shares_internals,
                               argc, argv);
 }
@@ -3572,8 +3556,7 @@ static int rpc_share_migrate_files(struct net_context *c, int argc, const char *
                return -1;
        }
 
-       return run_rpc_command(c, NULL,
-                              NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_srvsvc.syntax_id, 0,
                               rpc_share_migrate_files_internals,
                               argc, argv);
 }
@@ -3698,8 +3681,7 @@ static int rpc_share_migrate_security(struct net_context *c, int argc,
                return -1;
        }
 
-       return run_rpc_command(c, NULL,
-                              NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_srvsvc.syntax_id, 0,
                               rpc_share_migrate_security_internals,
                               argc, argv);
 }
@@ -3735,20 +3717,17 @@ 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_SRVSVC_UUID, NDR_SRVSVC_VERSION, 0,
+       ret = run_rpc_command(c, NULL, &ndr_table_srvsvc.syntax_id, 0,
                              rpc_share_migrate_shares_internals, argc, argv);
        if (ret)
                return ret;
 
-       ret = run_rpc_command(c, NULL,
-                             NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION, 0,
+       ret = run_rpc_command(c, NULL, &ndr_table_srvsvc.syntax_id, 0,
                              rpc_share_migrate_files_internals, argc, argv);
        if (ret)
                return ret;
 
-       return run_rpc_command(c, NULL,
-                              NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_srvsvc.syntax_id, 0,
                               rpc_share_migrate_security_internals, argc,
                               argv);
 }
@@ -4532,22 +4511,19 @@ static int rpc_share_allowedusers(struct net_context *c, int argc,
                return 0;
        }
 
-       result = run_rpc_command(c, NULL,
-                                NDR_SAMR_UUID, NDR_SAMR_VERSION, 0,
+       result = run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, 0,
                                 rpc_aliaslist_internals,
                                 argc, argv);
        if (result != 0)
                return result;
 
-       result = run_rpc_command(c, NULL,
-                                NDR_LSARPC_UUID, NDR_LSARPC_VERSION, 0,
+       result = run_rpc_command(c, NULL, &ndr_table_lsarpc.syntax_id, 0,
                                 rpc_aliaslist_dump,
                                 argc, argv);
        if (result != 0)
                return result;
 
-       return run_rpc_command(c, NULL,
-                              NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_srvsvc.syntax_id, 0,
                               rpc_share_allowedusers_internals,
                               argc, argv);
 }
@@ -4765,23 +4741,19 @@ 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_SRVSVC_UUID, NDR_SRVSVC_VERSION,
-                 rpc_sh_share_list,
-                 N_("List available shares") },
+       { "list", NULL, &ndr_table_srvsvc.syntax_id, rpc_sh_share_list,
+         N_("List available shares") },
 
-               { "add", NULL, NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION,
-                 rpc_sh_share_add,
-                 N_("Add a share") },
+       { "add", NULL, &ndr_table_srvsvc.syntax_id, rpc_sh_share_add,
+         N_("Add a share") },
 
-               { "delete", NULL, NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION,
-                 rpc_sh_share_delete,
-                 N_("Delete a share") },
+       { "delete", NULL, &ndr_table_srvsvc.syntax_id, rpc_sh_share_delete,
+         N_("Delete a share") },
 
-               { "info", NULL, NDR_SRVSVC_UUID, NDR_SRVSVC_VERSION,
-                 rpc_sh_share_info,
-                 N_("Get information about a share") },
+       { "info", NULL, &ndr_table_srvsvc.syntax_id, rpc_sh_share_info,
+         N_("Get information about a share") },
 
-               { NULL, NULL, 0, 0, NULL, NULL }
+       { NULL, NULL, 0, NULL, NULL }
        };
 
        return cmds;
@@ -5047,9 +5019,7 @@ static int rpc_shutdown_abort(struct net_context *c, int argc,
                return 0;
        }
 
-       rc = run_rpc_command(c, NULL,
-                            NDR_INITSHUTDOWN_UUID, NDR_INITSHUTDOWN_VERSION,
-                            0,
+       rc = run_rpc_command(c, NULL, &ndr_table_initshutdown.syntax_id, 0,
                             rpc_shutdown_abort_internals, argc, argv);
 
        if (rc == 0)
@@ -5057,8 +5027,7 @@ 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_WINREG_UUID, NDR_WINREG_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 0,
                               rpc_reg_shutdown_abort_internals,
                               argc, argv);
 }
@@ -5197,14 +5166,12 @@ static int rpc_shutdown(struct net_context *c, int argc, const char **argv)
                return 0;
        }
 
-       rc = run_rpc_command(c, NULL,
-                            NDR_INITSHUTDOWN_UUID, NDR_INITSHUTDOWN_VERSION,
-                            0, rpc_init_shutdown_internals, argc, argv);
+       rc = run_rpc_command(c, NULL, &ndr_table_initshutdown.syntax_id, 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_WINREG_UUID, NDR_WINREG_VERSION, 0,
+               rc = run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 0,
                                     rpc_reg_shutdown_internals, argc, argv);
        }
 
@@ -5362,8 +5329,7 @@ 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_SAMR_UUID, NDR_SAMR_VERSION, 0,
+               return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, 0,
                                       rpc_trustdom_add_internals, argc, argv);
        } else {
                d_printf(_("Usage:\n"
@@ -5521,8 +5487,7 @@ 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_SAMR_UUID, NDR_SAMR_VERSION, 0,
+               return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id, 0,
                                       rpc_trustdom_del_internals, argc, argv);
        } else {
                d_printf(_("Usage:\n"
@@ -6274,8 +6239,7 @@ 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_LSARPC_UUID,
-                                           NDR_LSARPC_VERSION, 0,
+                                           &ndr_table_lsarpc.syntax_id, 0,
                                            rpc_query_domain_sid, argc,
                                            argv))
                                        d_printf(_("strange - couldn't get domain's sid\n"));
@@ -6427,8 +6391,7 @@ static int rpc_samdump(struct net_context *c, int argc, const char **argv) {
                return 0;
        }
 
-       return run_rpc_command(c, NULL,
-                              NDR_NETLOGON_UUID, NDR_NETLOGON_VERSION,
+       return run_rpc_command(c, NULL, &ndr_table_netlogon.syntax_id,
                               NET_FLAGS_ANONYMOUS,
                               rpc_samdump_internals, argc, argv);
 }
@@ -6475,8 +6438,7 @@ static int rpc_vampire(struct net_context *c, int argc, const char **argv)
                        return 0;
                }
 
-               return run_rpc_command(c, NULL,
-                                      NDR_NETLOGON_UUID, NDR_NETLOGON_VERSION,
+               return run_rpc_command(c, NULL, &ndr_table_netlogon.syntax_id,
                                       NET_FLAGS_ANONYMOUS,
                                       rpc_vampire_internals,
                                       argc, argv);
@@ -6517,35 +6479,30 @@ static int rpc_printer_migrate_all(struct net_context *c, int argc,
                return -1;
        }
 
-       ret = run_rpc_command(c, NULL,
-                             NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
+       ret = run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
                              rpc_printer_migrate_printers_internals, argc,
                              argv);
        if (ret)
                return ret;
 
-       ret = run_rpc_command(c, NULL,
-                             NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
+       ret = run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
                              rpc_printer_migrate_drivers_internals, argc,
                              argv);
        if (ret)
                return ret;
 
-       ret = run_rpc_command(c, NULL,
-                             NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
+       ret = run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
                              rpc_printer_migrate_forms_internals, argc, argv);
        if (ret)
                return ret;
 
-       ret = run_rpc_command(c, NULL,
-                             NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
+       ret = run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
                              rpc_printer_migrate_settings_internals, argc,
                              argv);
        if (ret)
                return ret;
 
-       return run_rpc_command(c, NULL,
-                              NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
                               rpc_printer_migrate_security_internals, argc,
                               argv);
 
@@ -6576,8 +6533,7 @@ static int rpc_printer_migrate_drivers(struct net_context *c, int argc,
                return -1;
        }
 
-       return run_rpc_command(c, NULL,
-                              NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
                               rpc_printer_migrate_drivers_internals,
                               argc, argv);
 }
@@ -6607,8 +6563,7 @@ static int rpc_printer_migrate_forms(struct net_context *c, int argc,
                return -1;
        }
 
-       return run_rpc_command(c, NULL,
-                              NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
                               rpc_printer_migrate_forms_internals,
                               argc, argv);
 }
@@ -6638,8 +6593,7 @@ static int rpc_printer_migrate_printers(struct net_context *c, int argc,
                return -1;
        }
 
-       return run_rpc_command(c, NULL,
-                              NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
                               rpc_printer_migrate_printers_internals,
                               argc, argv);
 }
@@ -6669,8 +6623,7 @@ static int rpc_printer_migrate_security(struct net_context *c, int argc,
                return -1;
        }
 
-       return run_rpc_command(c, NULL,
-                              NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
                               rpc_printer_migrate_security_internals,
                               argc, argv);
 }
@@ -6701,8 +6654,7 @@ static int rpc_printer_migrate_settings(struct net_context *c, int argc,
                return -1;
        }
 
-       return run_rpc_command(c, NULL,
-                              NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
                               rpc_printer_migrate_settings_internals,
                               argc, argv);
 }
@@ -6798,8 +6750,7 @@ static int rpc_printer_list(struct net_context *c, int argc, const char **argv)
                return 0;
        }
 
-       return run_rpc_command(c, NULL,
-                              NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
                               rpc_printer_list_internals,
                               argc, argv);
 }
@@ -6824,8 +6775,8 @@ static int rpc_printer_driver_list(struct net_context *c, int argc,
                return 0;
        }
 
-       return run_rpc_command(c, NULL, NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION,
-                              0, rpc_printer_driver_list_internals,
+       return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
+                              rpc_printer_driver_list_internals,
                               argc, argv);
 }
 
@@ -6849,8 +6800,8 @@ static int rpc_printer_publish_publish(struct net_context *c, int argc,
                return 0;
        }
 
-       return run_rpc_command(c, NULL, NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION,
-                              0, rpc_printer_publish_publish_internals,
+       return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
+                              rpc_printer_publish_publish_internals,
                               argc, argv);
 }
 
@@ -6873,8 +6824,7 @@ static int rpc_printer_publish_update(struct net_context *c, int argc, const cha
                return 0;
        }
 
-       return run_rpc_command(c, NULL,
-                              NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
                               rpc_printer_publish_update_internals,
                               argc, argv);
 }
@@ -6899,8 +6849,7 @@ static int rpc_printer_publish_unpublish(struct net_context *c, int argc,
                return 0;
        }
 
-       return run_rpc_command(c, NULL,
-                              NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
                               rpc_printer_publish_unpublish_internals,
                               argc, argv);
 }
@@ -6925,8 +6874,7 @@ static int rpc_printer_publish_list(struct net_context *c, int argc,
                return 0;
        }
 
-       return run_rpc_command(c, NULL,
-                              NDR_SPOOLSS_UUID, NDR_SPOOLSS_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
                               rpc_printer_publish_list_internals,
                               argc, argv);
 }
@@ -6992,10 +6940,9 @@ 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_SPOOLSS_UUID, NDR_SPOOLSS_VERSION,
-                                      0, rpc_printer_publish_list_internals,
-                                      argc, argv);
+               return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
+                              rpc_printer_publish_list_internals,
+                              argc, argv);
        }
 
        return net_run_function(c, argc, argv, "net rpc printer publish",func);
@@ -7096,10 +7043,9 @@ 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_SPOOLSS_UUID, NDR_SPOOLSS_VERSION,
-                                      0, rpc_printer_list_internals,
-                                      argc, argv);
+               return run_rpc_command(c, NULL, &ndr_table_spoolss.syntax_id, 0,
+                              rpc_printer_list_internals,
+                              argc, argv);
        }
 
        return net_run_function(c, argc, argv, "net rpc printer", func);
index 4c79f027f4c6a25691280ca1e7a016ebdff253f3..bc3ed3dba24add0e48495f8440906ab31b584f9e 100644 (file)
@@ -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_LSARPC_UUID, NDR_LSARPC_VERSION, 0,
-                              rpc_audit_get_internal, argc, argv);
+       return run_rpc_command(c, NULL, &ndr_table_lsarpc.syntax_id, 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_LSARPC_UUID, NDR_LSARPC_VERSION, 0,
-                              rpc_audit_set_internal, argc, argv);
+       return run_rpc_command(c, NULL, &ndr_table_lsarpc.syntax_id, 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_LSARPC_UUID, NDR_LSARPC_VERSION, 0,
-                              rpc_audit_enable_internal, argc, argv);
+       return run_rpc_command(c, NULL, &ndr_table_lsarpc.syntax_id, 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_LSARPC_UUID, NDR_LSARPC_VERSION, 0,
-                              rpc_audit_disable_internal, argc, argv);
+       return run_rpc_command(c, NULL, &ndr_table_lsarpc.syntax_id, 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_LSARPC_UUID, NDR_LSARPC_VERSION, 0,
-                              rpc_audit_list_internal, argc, argv);
+       return run_rpc_command(c, NULL, &ndr_table_lsarpc.syntax_id, 0,
+               rpc_audit_list_internal, argc, argv);
 }
 
 /********************************************************************
index 0f0eac94d4effae084afb8ba1074d0e80a850191..36e83a75af8e1bdf07f44d1caa1ca95208d1baa3 100644 (file)
@@ -475,8 +475,8 @@ static int rpc_registry_setvalue(struct net_context *c, int argc,
                return -1;
        }
 
-       return run_rpc_command(c, NULL, NDR_WINREG_UUID, NDR_WINREG_VERSION, 0,
-                              rpc_registry_setvalue_internal, argc, argv );
+       return run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 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_WINREG_UUID, NDR_WINREG_VERSION, 0,
-                              rpc_registry_deletevalue_internal, argc, argv );
+       return run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 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_WINREG_UUID, NDR_WINREG_VERSION, 0,
-                              rpc_registry_getvalue_full, argc, argv);
+       return run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 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_WINREG_UUID, NDR_WINREG_VERSION, 0,
-                              rpc_registry_getvalue_raw, argc, argv);
+       return run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 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_WINREG_UUID, NDR_WINREG_VERSION, 0,
-                              rpc_registry_createkey_internal, argc, argv );
+       return run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 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_WINREG_UUID, NDR_WINREG_VERSION, 0,
-                              rpc_registry_deletekey_internal, argc, argv );
+       return run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 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_WINREG_UUID, NDR_WINREG_VERSION, 0,
-                              rpc_registry_enumerate_internal, argc, argv );
+       return run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 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_WINREG_UUID, NDR_WINREG_VERSION, 0,
-                              rpc_registry_save_internal, argc, argv );
+       return run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 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_WINREG_UUID, NDR_WINREG_VERSION, 0,
-                              rpc_registry_getsd_internal, argc, argv);
+       return run_rpc_command(c, NULL, &ndr_table_winreg.syntax_id, 0,
+               rpc_registry_getsd_internal, argc, argv);
 }
 
 /********************************************************************
index b83a513443391c633a0b4025c7f759de4b5e8132..defed479149f4e3416cab20cff9226ecd02eb877 100644 (file)
@@ -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_LSARPC_UUID, NDR_LSARPC_VERSION, 0,
-                              rpc_rights_list_internal, argc, argv );
+       return run_rpc_command(c, NULL, &ndr_table_lsarpc.syntax_id, 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_LSARPC_UUID, NDR_LSARPC_VERSION, 0,
-                              rpc_rights_grant_internal, argc, argv );
+       return run_rpc_command(c, NULL, &ndr_table_lsarpc.syntax_id, 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_LSARPC_UUID, NDR_LSARPC_VERSION, 0,
-                              rpc_rights_revoke_internal, argc, argv );
+       return run_rpc_command(c, NULL, &ndr_table_lsarpc.syntax_id, 0,
+               rpc_rights_revoke_internal, argc, argv );
 }
 
 /********************************************************************
@@ -702,19 +702,16 @@ 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_LSARPC_UUID, NDR_LSARPC_VERSION,
-                 rpc_sh_rights_list,
-                 N_("View available or assigned privileges") },
+       { "list", NULL, &ndr_table_lsarpc.syntax_id, rpc_sh_rights_list,
+         N_("View available or assigned privileges") },
 
-               { "grant", NULL, NDR_LSARPC_UUID, NDR_LSARPC_VERSION,
-                 rpc_sh_rights_grant,
-                 N_("Assign privilege[s]") },
+       { "grant", NULL, &ndr_table_lsarpc.syntax_id, rpc_sh_rights_grant,
+         N_("Assign privilege[s]") },
 
-               { "revoke", NULL, NDR_LSARPC_UUID, NDR_LSARPC_VERSION,
-                 rpc_sh_rights_revoke,
-                 N_("Revoke privilege[s]") },
+       { "revoke", NULL, &ndr_table_lsarpc.syntax_id, rpc_sh_rights_revoke,
+         N_("Revoke privilege[s]") },
 
-               { NULL, NULL, 0, 0, NULL, NULL }
+       { NULL, NULL, 0, NULL, NULL }
        };
 
        return cmds;
index 370c075f2cb702c7269d80813a2b84f4542e44d8..89568eef94d2e565140ecb08a8ccd4b24b036bab 100644 (file)
@@ -258,8 +258,7 @@ int rpc_vampire_passdb(struct net_context *c, int argc, const char **argv)
                return 0;
        }
 
-       return run_rpc_command(c, NULL,
-                              NDR_NETLOGON_UUID, NDR_NETLOGON_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_netlogon.syntax_id, 0,
                               rpc_vampire_internals, argc, argv);
 }
 
@@ -341,8 +340,7 @@ int rpc_vampire_ldif(struct net_context *c, int argc, const char **argv)
                return 0;
        }
 
-       return run_rpc_command(c, NULL,
-                              NDR_NETLOGON_UUID, NDR_NETLOGON_VERSION, 0,
+       return run_rpc_command(c, NULL, &ndr_table_netlogon.syntax_id, 0,
                               rpc_vampire_ldif_internals, argc, argv);
 }
 
@@ -498,25 +496,20 @@ 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_NETLOGON_UUID, NDR_NETLOGON_VERSION,
-                                     0, rpc_vampire_keytab_internals,
-                                     argc, argv);
+               ret = run_rpc_command(c, cli, &ndr_table_netlogon.syntax_id,
+                                     0,
+                                     rpc_vampire_keytab_internals, argc, argv);
                return -1;
        } else {
-               ret = run_rpc_command(c, cli,
-                                     NDR_DRSUAPI_UUID, NDR_DRSUAPI_VERSION,
+               ret = run_rpc_command(c, cli, &ndr_table_drsuapi.syntax_id,
                                      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_NETLOGON_UUID,
-                                             NDR_NETLOGON_VERSION,
+                       ret = run_rpc_command(c, cli, &ndr_table_netlogon.syntax_id,
                                              0,
-                                             rpc_vampire_keytab_internals,
-                                             argc, argv);
+                                             rpc_vampire_keytab_internals, argc, argv);
                }
        }
 
index c447b1d889bc03e51bdd118d503cdfc6f84a64c1..1ef7c3ed098526237b6417b2d73ccc9e0e22e3e3 100644 (file)
@@ -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_SVCCTL_UUID, NDR_SVCCTL_VERSION, 0,
-                              rpc_service_list_internal, argc, argv );
+       return run_rpc_command(c, NULL, &ndr_table_svcctl.syntax_id, 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_SVCCTL_UUID, NDR_SVCCTL_VERSION, 0,
-                              rpc_service_start_internal, argc, argv );
+       return run_rpc_command(c, NULL, &ndr_table_svcctl.syntax_id, 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_SVCCTL_UUID, NDR_SVCCTL_VERSION, 0,
-                              rpc_service_stop_internal, argc, argv );
+       return run_rpc_command(c, NULL, &ndr_table_svcctl.syntax_id, 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_SVCCTL_UUID, NDR_SVCCTL_VERSION, 0,
-                              rpc_service_resume_internal, argc, argv );
+       return run_rpc_command(c, NULL, &ndr_table_svcctl.syntax_id, 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_SVCCTL_UUID, NDR_SVCCTL_VERSION, 0,
-                              rpc_service_pause_internal, argc, argv );
+       return run_rpc_command(c, NULL, &ndr_table_svcctl.syntax_id, 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_SVCCTL_UUID, NDR_SVCCTL_VERSION, 0,
-                              rpc_service_status_internal, argc, argv );
+       return run_rpc_command(c, NULL, &ndr_table_svcctl.syntax_id, 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_SVCCTL_UUID, NDR_SVCCTL_VERSION, 0,
-                              rpc_service_delete_internal, argc, argv);
+       return run_rpc_command(c, NULL, &ndr_table_svcctl.syntax_id, 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_SVCCTL_UUID, NDR_SVCCTL_VERSION, 0,
-                              rpc_service_create_internal, argc, argv);
+       return run_rpc_command(c, NULL, &ndr_table_svcctl.syntax_id, 0,
+               rpc_service_create_internal, argc, argv);
 }
 
 /********************************************************************
index 9b788a47156c459650f7ca32d0a10338557f93dd..83ce3551d1c3ef4d2dc4ff8c0c1e174f5a5fec26 100644 (file)
@@ -430,31 +430,24 @@ 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_SAMR_UUID, NDR_SAMR_VERSION,
-                 rpc_sh_acct_pol_show,
+               { "show", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_pol_show,
                  N_("Show current account policy settings") },
-               { "badpw", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
-                 rpc_sh_acct_set_badpw,
+               { "badpw", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_set_badpw,
                  N_("Set bad password count before lockout") },
-               { "lockduration", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
-                 rpc_sh_acct_set_lockduration,
+               { "lockduration", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_set_lockduration,
                  N_("Set account lockout duration") },
-               { "resetduration", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
+               { "resetduration", NULL, &ndr_table_samr.syntax_id,
                  rpc_sh_acct_set_resetduration,
                  N_("Set bad password count reset duration") },
-               { "minpwage", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
-                 rpc_sh_acct_set_minpwage,
+               { "minpwage", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_set_minpwage,
                  N_("Set minimum password age") },
-               { "maxpwage", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
-                 rpc_sh_acct_set_maxpwage,
+               { "maxpwage", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_set_maxpwage,
                  N_("Set maximum password age") },
-               { "minpwlen", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
-                 rpc_sh_acct_set_minpwlen,
+               { "minpwlen", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_set_minpwlen,
                  N_("Set minimum password length") },
-               { "pwhistlen", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION,
-                 rpc_sh_acct_set_pwhistlen,
+               { "pwhistlen", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_set_pwhistlen,
                  N_("Set the password history length") },
-               { NULL, NULL, NULL, 0, NULL, NULL }
+               { NULL, NULL, 0, NULL, NULL }
        };
 
        return cmds;
index 5b94fac145c509423ef3649a32dccd78fd8dd8ba..5e0f1503712f6a4660ef8f57932b376a216a559b 100644 (file)
@@ -70,21 +70,16 @@ 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, &syntax, &pipe_hnd);
+       status = cli_rpc_pipe_open_noauth(ctx->cli, cmd->interface,
+                                         &pipe_hnd);
        if (!NT_STATUS_IS_OK(status)) {
                d_fprintf(stderr, _("Could not open pipe: %s\n"),
                          nt_errstr(status));
@@ -195,22 +190,22 @@ static bool net_sh_process(struct net_context *c,
 
 static struct rpc_sh_cmd sh_cmds[6] = {
 
-       { "info", NULL, NDR_SAMR_UUID, NDR_SAMR_VERSION, rpc_sh_info,
+       { "info", NULL, &ndr_table_samr.syntax_id, rpc_sh_info,
          N_("Print information about the domain connected to") },
 
-       { "rights", net_rpc_rights_cmds, NULL, 0, NULL,
+       { "rights", net_rpc_rights_cmds, 0, NULL,
          N_("List/Grant/Revoke user rights") },
 
-       { "share", net_rpc_share_cmds, NULL, 0, NULL,
+       { "share", net_rpc_share_cmds, 0, NULL,
          N_("List/Add/Remove etc shares") },
 
-       { "user", net_rpc_user_cmds, NULL, 0, NULL,
+       { "user", net_rpc_user_cmds, 0, NULL,
          N_("List/Add/Remove user info") },
 
-       { "account", net_rpc_acct_cmds, NULL, 0, NULL,
+       { "account", net_rpc_acct_cmds, 0, NULL,
          N_("Show/Change account policy settings") },
 
-       { NULL, NULL, NULL, 0, NULL, NULL }
+       { NULL, NULL, 0, NULL, NULL }
 };
 
 int net_rpc_shell(struct net_context *c, int argc, const char **argv)