diff options
Diffstat (limited to 'source3/rpcclient')
-rw-r--r-- | source3/rpcclient/cmd_spoolss.c | 8 | ||||
-rw-r--r-- | source3/rpcclient/rpcclient.c | 23 |
2 files changed, 16 insertions, 15 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c index 92d8096505..a7969bddd1 100644 --- a/source3/rpcclient/cmd_spoolss.c +++ b/source3/rpcclient/cmd_spoolss.c @@ -2671,11 +2671,11 @@ static WERROR cmd_spoolss_printercmp(struct rpc_pipe_client *cli, nt_status = cli_full_connection(&cli_server2, global_myname(), servername2, NULL, 0, "IPC$", "IPC", - cmdline_auth_info.username, + get_cmdline_auth_info_username(), lp_workgroup(), - cmdline_auth_info.password, - cmdline_auth_info.use_kerberos ? CLI_FULL_CONNECTION_USE_KERBEROS : 0, - cmdline_auth_info.signing_state, NULL); + get_cmdline_auth_info_password(), + get_cmdline_auth_info_use_kerberos() ? CLI_FULL_CONNECTION_USE_KERBEROS : 0, + get_cmdline_auth_info_signing_state(), NULL); if ( !NT_STATUS_IS_OK(nt_status) ) return WERR_GENERAL_FAILURE; diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index ea7db88224..627c821baa 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -571,8 +571,8 @@ static NTSTATUS do_cmd(struct cli_state *cli, cmd_entry->pipe_idx, pipe_default_auth_level, lp_workgroup(), - cmdline_auth_info.username, - cmdline_auth_info.password, + get_cmdline_auth_info_username(), + get_cmdline_auth_info_password(), &ntresult); break; case PIPE_AUTH_TYPE_NTLMSSP: @@ -580,8 +580,8 @@ static NTSTATUS do_cmd(struct cli_state *cli, cmd_entry->pipe_idx, pipe_default_auth_level, lp_workgroup(), - cmdline_auth_info.username, - cmdline_auth_info.password, + get_cmdline_auth_info_username(), + get_cmdline_auth_info_password(), &ntresult); break; case PIPE_AUTH_TYPE_SCHANNEL: @@ -823,10 +823,10 @@ out_free: * from stdin if necessary */ - if (!cmdline_auth_info.got_pass) { + if (!get_cmdline_auth_info_got_pass()) { char *pass = getpass("Password:"); if (pass) { - pstrcpy(cmdline_auth_info.password, pass); + set_cmdline_auth_info_password(pass); } } @@ -838,11 +838,11 @@ out_free: nt_status = cli_full_connection(&cli, global_myname(), server, opt_ipaddr ? &server_ss : NULL, opt_port, "IPC$", "IPC", - cmdline_auth_info.username, + get_cmdline_auth_info_username(), lp_workgroup(), - cmdline_auth_info.password, - cmdline_auth_info.use_kerberos ? CLI_FULL_CONNECTION_USE_KERBEROS : 0, - cmdline_auth_info.signing_state,NULL); + get_cmdline_auth_info_password(), + get_cmdline_auth_info_use_kerberos() ? CLI_FULL_CONNECTION_USE_KERBEROS : 0, + get_cmdline_auth_info_signing_state(),NULL); if (!NT_STATUS_IS_OK(nt_status)) { DEBUG(0,("Cannot connect to server. Error was %s\n", nt_errstr(nt_status))); @@ -887,7 +887,7 @@ out_free: /* Loop around accepting commands */ while(1) { - char *line; + char *line = NULL; line = smb_readline("rpcclient $> ", NULL, completion_fn); @@ -896,6 +896,7 @@ out_free: if (line[0] != '\n') process_cmd(cli, line); + SAFE_FREE(line); } done: |