git: 9front

Download patch

ref: 0de676b90df85f6660a071469c623dd87a472a45
parent: 46a0c7b4d96843fedbd49027a9efa6f2a78d2b33
author: aiju <devnull@localhost>
date: Mon Apr 24 19:26:43 EDT 2017

ssh: make number of retries configurable

--- a/sys/man/1/ssh
+++ b/sys/man/1/ssh
@@ -60,6 +60,13 @@
 .B -R
 option.
 .PP
+If
+.I keyboard-interactive
+authentication fails, by default it is retried three times.
+The number of tries can be changed with
+.BR -T .
+Setting it to zero disables keyboard-interactive authentication.
+.PP
 The
 .B -d
 option enables debug output.
--- a/sys/src/cmd/ssh.c
+++ b/sys/src/cmd/ssh.c
@@ -52,9 +52,7 @@
 	WinPackets = 8,		// (1<<15) * 8 = 256K
 };
 
-enum {
-	MaxPwTries = 3 // retry this often for keyboard-interactive
-};
+int MaxPwTries = 3; // retry this often for keyboard-interactive
 
 typedef struct
 {
@@ -1151,6 +1149,10 @@
 		break;
 	case 't':
 		thumbfile = EARGF(usage());
+		break;
+	case 'T':
+		MaxPwTries = strtol(EARGF(usage()), &s, 0);
+		if(*s != 0) usage();
 		break;
 	} ARGEND;
 
--