diff options
Diffstat (limited to 'source3/rpcclient/rpcclient.c')
-rw-r--r-- | source3/rpcclient/rpcclient.c | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index dc93c0536b..9d2a0de92d 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -25,20 +25,15 @@ extern int DEBUGLEVEL; extern fstring debugf; -/* Various pipe commands */ -extern struct cmd_set lsarpc_commands[]; -extern struct cmd_set samr_commands[]; -extern struct cmd_set spoolss_commands[]; +DOM_SID domain_sid; /* List to hold groups of commands */ + static struct cmd_list { struct cmd_list *prev, *next; struct cmd_set *cmd_set; } *cmd_list; - -DOM_SID domain_sid; - /**************************************************************************** handle completion of commands for readline ****************************************************************************/ @@ -323,6 +318,24 @@ static struct cmd_set separator_command[] = { }; +/* Various pipe commands */ + +extern struct cmd_set lsarpc_commands[]; +extern struct cmd_set samr_commands[]; +extern struct cmd_set spoolss_commands[]; +extern struct cmd_set netlogon_commands[]; +extern struct cmd_set srvsvc_commands[]; + +static struct cmd_set *rpcclient_command_list[] = { + rpcclient_commands, + lsarpc_commands, + samr_commands, + spoolss_commands, + netlogon_commands, + srvsvc_commands, + NULL +}; + void add_command_set(struct cmd_set *cmd_set) { struct cmd_list *entry; @@ -519,6 +532,7 @@ static void usage(char *pname) username, domain, server; + struct cmd_set **cmd_set; charset_initialise(); setlinebuf(stdout); @@ -634,22 +648,21 @@ static void usage(char *pname) } /* There are no pointers in ntuser_creds struct so zero it out */ + ZERO_STRUCTP (&creds); /* Load command lists */ - add_command_set(rpcclient_commands); - add_command_set(separator_command); - - add_command_set(spoolss_commands); - add_command_set(separator_command); - add_command_set(lsarpc_commands); - add_command_set(separator_command); + cmd_set = rpcclient_command_list; - add_command_set(samr_commands); - add_command_set(separator_command); + while(*cmd_set) { + add_command_set(*cmd_set); + add_command_set(separator_command); + cmd_set++; + } /* Do anything specified with -c */ + if (cmdstr[0]) { char *cmd; char *p = cmdstr; @@ -662,6 +675,7 @@ static void usage(char *pname) } /* Loop around accepting commands */ + while(1) { pstring prompt; char *line; |