comparison cli-auth.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 baea1d43e7eb
children fdf06a5a54e4
comparison
equal deleted inserted replaced
333:9341570412e5 334:8f3ec7c104d9
279 TRACE(("leave cli_auth_try")) 279 TRACE(("leave cli_auth_try"))
280 } 280 }
281 281
282 /* A helper for getpass() that exits if the user cancels. The returned 282 /* A helper for getpass() that exits if the user cancels. The returned
283 * password is statically allocated by getpass() */ 283 * password is statically allocated by getpass() */
284 char* getpass_or_cancel() 284 char* getpass_or_cancel(char* prompt)
285 { 285 {
286 char* password = NULL; 286 char* password = NULL;
287 287
288 password = getpass("Password: "); 288 password = getpass(prompt);
289 289
290 /* 0x03 is a ctrl-c character in the buffer. */ 290 /* 0x03 is a ctrl-c character in the buffer. */
291 if (password == NULL || strchr(password, '\3') != NULL) { 291 if (password == NULL || strchr(password, '\3') != NULL) {
292 dropbear_close("Interrupted."); 292 dropbear_close("Interrupted.");
293 } 293 }