summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/sshconnect2.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2000-05-03 17:55:22 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2000-05-03 17:55:22 +0000
commit8c5d10c8517a7e709445041d94b7058fab751a81 (patch)
tree304fbf83292ccc925587647de9361e0b07e091d2 /usr.bin/ssh/sshconnect2.c
parentcd7569db6082c6bf69883fe61c88fb632fcdce80 (diff)
respect number_of_password_prompts
Diffstat (limited to 'usr.bin/ssh/sshconnect2.c')
-rw-r--r--usr.bin/ssh/sshconnect2.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/ssh/sshconnect2.c b/usr.bin/ssh/sshconnect2.c
index a4342e2df08..a92e578e63c 100644
--- a/usr.bin/ssh/sshconnect2.c
+++ b/usr.bin/ssh/sshconnect2.c
@@ -28,7 +28,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: sshconnect2.c,v 1.5 2000/05/01 18:41:06 markus Exp $");
+RCSID("$OpenBSD: sshconnect2.c,v 1.6 2000/05/03 17:55:21 markus Exp $");
#include <openssl/bn.h>
#include <openssl/rsa.h>
@@ -283,9 +283,13 @@ ssh_kex2(char *host, struct sockaddr *hostaddr)
int
ssh2_try_passwd(const char *server_user, const char *host, const char *service)
{
+ static int attempt = 0;
char prompt[80];
char *password;
+ if (attempt++ > options.number_of_password_prompts)
+ return 0;
+
snprintf(prompt, sizeof(prompt), "%.30s@%.40s's password: ",
server_user, host);
password = read_passphrase(prompt, 0);