Mercurial > dropbear
comparison cli-authpasswd.c @ 435:337c45621e81
merge of 'a9b0496634cdd25647b65e585cc3240f3fa699ee'
and 'c22be8b8f570b48e9662dac32c7b3e7148a42206'
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 22 Feb 2007 14:53:49 +0000 |
parents | 8f3ec7c104d9 |
children | bde853a9e680 |
comparison
equal
deleted
inserted
replaced
434:0aaaf68e97dc | 435:337c45621e81 |
---|---|
114 #endif /* ENABLE_CLI_ASKPASS_HELPER */ | 114 #endif /* ENABLE_CLI_ASKPASS_HELPER */ |
115 | 115 |
116 void cli_auth_password() { | 116 void cli_auth_password() { |
117 | 117 |
118 char* password = NULL; | 118 char* password = NULL; |
119 char prompt[80]; | |
119 | 120 |
120 TRACE(("enter cli_auth_password")) | 121 TRACE(("enter cli_auth_password")) |
121 CHECKCLEARTOWRITE(); | 122 CHECKCLEARTOWRITE(); |
122 | 123 |
124 snprintf(prompt, sizeof(prompt), "%s@%s's password: ", | |
125 cli_opts.username, cli_opts.remotehost); | |
123 #ifdef ENABLE_CLI_ASKPASS_HELPER | 126 #ifdef ENABLE_CLI_ASKPASS_HELPER |
124 if (want_askpass()) | 127 if (want_askpass()) |
125 password = gui_getpass("Password: "); | 128 password = gui_getpass(prompt); |
126 else | 129 else |
127 #endif | 130 #endif |
128 password = getpass_or_cancel("Password: "); | 131 password = getpass_or_cancel(prompt); |
129 | 132 |
130 buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST); | 133 buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST); |
131 | 134 |
132 buf_putstring(ses.writepayload, cli_opts.username, | 135 buf_putstring(ses.writepayload, cli_opts.username, |
133 strlen(cli_opts.username)); | 136 strlen(cli_opts.username)); |