comparison cli-authpasswd.c @ 334:8f3ec7c104d9

Make the dbclient password prompt more useful
author Matt Johnston <matt@ucc.asn.au>
date Mon, 12 Jun 2006 14:41:32 +0000
parents 475a818dd6e7
children bde853a9e680
comparison
equal deleted inserted replaced
333:9341570412e5 334:8f3ec7c104d9
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), "%[email protected]%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));