*
* @returns The NTSTATUS from running the command.
**/
-static NTSTATUS process_cmd(struct user_auth_info *auth_info,
+static NTSTATUS process_cmd(struct cli_credentials *creds,
struct cli_state *cli,
struct dcerpc_binding *binding,
char *cmd)
int ret;
int argc;
const char **argv = NULL;
- struct cli_credentials *creds =
- get_cmdline_auth_info_creds(auth_info);
if ((ret = poptParseArgvString(cmd, &argc, &argv)) != 0) {
fprintf(stderr, "rpcclient: %s\n", poptStrerror(ret));
const char *binding_string = NULL;
const char *host;
int signing_state = SMB_SIGNING_IPC_DEFAULT;
+ struct cli_credentials *creds = NULL;
/* make sure the vars that get altered (4th field) are in
a fixed location or certain compilers complain */
popt_burn_cmdline_password(argc, argv);
rpcclient_msg_ctx = cmdline_messaging_context(get_dyn_CONFIGFILE());
+ creds = get_cmdline_auth_info_creds(popt_get_cmdline_auth_info());
/*
* Get password
result = 0;
while((cmd=next_command(&p)) != NULL) {
- NTSTATUS cmd_result = process_cmd(
- popt_get_cmdline_auth_info(),
- cli, binding, cmd);
+ NTSTATUS cmd_result = process_cmd(creds,
+ cli,
+ binding,
+ cmd);
SAFE_FREE(cmd);
result = NT_STATUS_IS_ERR(cmd_result);
}
}
if (line[0] != '\n')
- process_cmd(popt_get_cmdline_auth_info(), cli,
- binding, line);
+ process_cmd(creds,
+ cli,
+ binding,
+ line);
SAFE_FREE(line);
}