1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

Refactoring: net_sh_run uses ndr_syntax_id instead of pipe_idx

(This used to be commit 85c8363d51)
This commit is contained in:
Volker Lendecke 2008-07-20 18:40:31 +02:00
parent f23567fcb9
commit d86ff59989
5 changed files with 31 additions and 32 deletions

View File

@ -115,7 +115,7 @@ struct rpc_sh_cmd {
struct rpc_sh_cmd *(*sub)(struct net_context *c,
TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx);
int pipe_idx;
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,

View File

@ -1592,34 +1592,34 @@ struct rpc_sh_cmd *net_rpc_user_edit_cmds(struct net_context *c,
{
static struct rpc_sh_cmd cmds[] = {
{ "fullname", NULL, PI_SAMR, rpc_sh_user_str_edit,
{ "fullname", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_str_edit,
"Show/Set a user's full name" },
{ "homedir", NULL, PI_SAMR, rpc_sh_user_str_edit,
{ "homedir", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_str_edit,
"Show/Set a user's home directory" },
{ "homedrive", NULL, PI_SAMR, rpc_sh_user_str_edit,
{ "homedrive", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_str_edit,
"Show/Set a user's home drive" },
{ "logonscript", NULL, PI_SAMR, rpc_sh_user_str_edit,
{ "logonscript", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_str_edit,
"Show/Set a user's logon script" },
{ "profilepath", NULL, PI_SAMR, rpc_sh_user_str_edit,
{ "profilepath", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_str_edit,
"Show/Set a user's profile path" },
{ "description", NULL, PI_SAMR, rpc_sh_user_str_edit,
{ "description", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_str_edit,
"Show/Set a user's description" },
{ "disabled", NULL, PI_SAMR, rpc_sh_user_flag_edit,
{ "disabled", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_flag_edit,
"Show/Set whether a user is disabled" },
{ "autolock", NULL, PI_SAMR, rpc_sh_user_flag_edit,
{ "autolock", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_flag_edit,
"Show/Set whether a user locked out" },
{ "pwnotreq", NULL, PI_SAMR, rpc_sh_user_flag_edit,
{ "pwnotreq", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_flag_edit,
"Show/Set whether a user does not need a password" },
{ "pwnoexp", NULL, PI_SAMR, rpc_sh_user_flag_edit,
{ "pwnoexp", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_flag_edit,
"Show/Set whether a user's password does not expire" },
{ NULL, NULL, 0, NULL, NULL }
@ -1634,13 +1634,13 @@ struct rpc_sh_cmd *net_rpc_user_cmds(struct net_context *c,
{
static struct rpc_sh_cmd cmds[] = {
{ "list", NULL, PI_SAMR, rpc_sh_user_list,
{ "list", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_list,
"List available users" },
{ "info", NULL, PI_SAMR, rpc_sh_user_info,
{ "info", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_info,
"List the domain groups a user is member of" },
{ "show", NULL, PI_SAMR, rpc_sh_user_show,
{ "show", NULL, &ndr_table_samr.syntax_id, rpc_sh_user_show,
"Show info about a user" },
{ "edit", net_rpc_user_edit_cmds, 0, NULL,
@ -5119,16 +5119,16 @@ struct rpc_sh_cmd *net_rpc_share_cmds(struct net_context *c, TALLOC_CTX *mem_ctx
{
static struct rpc_sh_cmd cmds[] = {
{ "list", NULL, PI_SRVSVC, rpc_sh_share_list,
{ "list", NULL, &ndr_table_srvsvc.syntax_id, rpc_sh_share_list,
"List available shares" },
{ "add", NULL, PI_SRVSVC, rpc_sh_share_add,
{ "add", NULL, &ndr_table_srvsvc.syntax_id, rpc_sh_share_add,
"Add a share" },
{ "delete", NULL, PI_SRVSVC, rpc_sh_share_delete,
{ "delete", NULL, &ndr_table_srvsvc.syntax_id, rpc_sh_share_delete,
"Delete a share" },
{ "info", NULL, PI_SRVSVC, rpc_sh_share_info,
{ "info", NULL, &ndr_table_srvsvc.syntax_id, rpc_sh_share_info,
"Get information about a share" },
{ NULL, NULL, 0, NULL, NULL }

View File

@ -691,13 +691,13 @@ struct rpc_sh_cmd *net_rpc_rights_cmds(struct net_context *c, TALLOC_CTX *mem_ct
{
static struct rpc_sh_cmd cmds[] = {
{ "list", NULL, PI_LSARPC, rpc_sh_rights_list,
{ "list", NULL, &ndr_table_lsarpc.syntax_id, rpc_sh_rights_list,
"View available or assigned privileges" },
{ "grant", NULL, PI_LSARPC, rpc_sh_rights_grant,
{ "grant", NULL, &ndr_table_lsarpc.syntax_id, rpc_sh_rights_grant,
"Assign privilege[s]" },
{ "revoke", NULL, PI_LSARPC, rpc_sh_rights_revoke,
{ "revoke", NULL, &ndr_table_lsarpc.syntax_id, rpc_sh_rights_revoke,
"Revoke privilege[s]" },
{ NULL, NULL, 0, NULL, NULL }

View File

@ -429,22 +429,22 @@ 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, PI_SAMR, rpc_sh_acct_pol_show,
{ "show", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_pol_show,
"Show current account policy settings" },
{ "badpw", NULL, PI_SAMR, rpc_sh_acct_set_badpw,
{ "badpw", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_set_badpw,
"Set bad password count before lockout" },
{ "lockduration", NULL, PI_SAMR, rpc_sh_acct_set_lockduration,
{ "lockduration", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_set_lockduration,
"Set account lockout duration" },
{ "resetduration", NULL, PI_SAMR,
{ "resetduration", NULL, &ndr_table_samr.syntax_id,
rpc_sh_acct_set_resetduration,
"Set bad password count reset duration" },
{ "minpwage", NULL, PI_SAMR, rpc_sh_acct_set_minpwage,
{ "minpwage", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_set_minpwage,
"Set minimum password age" },
{ "maxpwage", NULL, PI_SAMR, rpc_sh_acct_set_maxpwage,
{ "maxpwage", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_set_maxpwage,
"Set maximum password age" },
{ "minpwlen", NULL, PI_SAMR, rpc_sh_acct_set_minpwlen,
{ "minpwlen", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_set_minpwlen,
"Set minimum password length" },
{ "pwhistlen", NULL, PI_SAMR, rpc_sh_acct_set_pwhistlen,
{ "pwhistlen", NULL, &ndr_table_samr.syntax_id, rpc_sh_acct_set_pwhistlen,
"Set the password history length" },
{ NULL, NULL, 0, NULL, NULL }
};

View File

@ -78,8 +78,7 @@ static NTSTATUS net_sh_run(struct net_context *c,
return NT_STATUS_NO_MEMORY;
}
status = cli_rpc_pipe_open_noauth(ctx->cli,
cli_get_iface(cmd->pipe_idx),
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",
@ -189,7 +188,7 @@ static bool net_sh_process(struct net_context *c,
static struct rpc_sh_cmd sh_cmds[6] = {
{ "info", NULL, PI_SAMR, rpc_sh_info,
{ "info", NULL, &ndr_table_samr.syntax_id, rpc_sh_info,
"Print information about the domain connected to" },
{ "rights", net_rpc_rights_cmds, 0, NULL,