From 1e03393b6813b8dc77916665d8940475f06acdb2 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Sat, 25 Mar 2006 12:57:37 +0000 Subject: Some cleanups/fixes for various TRACE statements --HG-- extra : convert_revision : 84eb6fedc6df0666f8053b9018bf16635dbfb257 --- cli-auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cli-auth.c') diff --git a/cli-auth.c b/cli-auth.c index d08de9a..ba4cf6c 100644 --- a/cli-auth.c +++ b/cli-auth.c @@ -236,8 +236,8 @@ void recv_msg_userauth_success() { void cli_auth_try() { - TRACE(("enter cli_auth_try")) int finished = 0; + TRACE(("enter cli_auth_try")) CHECKCLEARTOWRITE(); -- cgit v1.2.3 From d0537c7506af0f7193fd11a63ccbac04a464485a Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Mon, 12 Jun 2006 14:41:32 +0000 Subject: Make the dbclient password prompt more useful --HG-- extra : convert_revision : 3bcfb35f7a6065dafbd695d943b95d64efff1c99 --- auth.h | 2 +- cli-auth.c | 4 ++-- cli-authpasswd.c | 7 +++++-- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'cli-auth.c') diff --git a/auth.h b/auth.h index c407ad5..661265a 100644 --- a/auth.h +++ b/auth.h @@ -52,7 +52,7 @@ void cli_pubkeyfail(); void cli_auth_password(); int cli_auth_pubkey(); void cli_auth_interactive(); -char* getpass_or_cancel(); +char* getpass_or_cancel(char* prompt); #define MAX_USERNAME_LEN 25 /* arbitrary for the moment */ diff --git a/cli-auth.c b/cli-auth.c index ba4cf6c..4c17a21 100644 --- a/cli-auth.c +++ b/cli-auth.c @@ -281,11 +281,11 @@ void cli_auth_try() { /* A helper for getpass() that exits if the user cancels. The returned * password is statically allocated by getpass() */ -char* getpass_or_cancel() +char* getpass_or_cancel(char* prompt) { char* password = NULL; - password = getpass("Password: "); + password = getpass(prompt); /* 0x03 is a ctrl-c character in the buffer. */ if (password == NULL || strchr(password, '\3') != NULL) { diff --git a/cli-authpasswd.c b/cli-authpasswd.c index 5dffac4..2500a25 100644 --- a/cli-authpasswd.c +++ b/cli-authpasswd.c @@ -116,16 +116,19 @@ static char *gui_getpass(const char *prompt) { void cli_auth_password() { char* password = NULL; + char prompt[80]; TRACE(("enter cli_auth_password")) CHECKCLEARTOWRITE(); + snprintf(prompt, sizeof(prompt), "%s@%s's password: ", + cli_opts.username, cli_opts.remotehost); #ifdef ENABLE_CLI_ASKPASS_HELPER if (want_askpass()) - password = gui_getpass("Password: "); + password = gui_getpass(prompt); else #endif - password = getpass_or_cancel("Password: "); + password = getpass_or_cancel(prompt); buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST); -- cgit v1.2.3