comparison svr-auth.c @ 1442:517c67cbcd31

dropbear server: support -T max auth tries Add support for '-T n' for a run-time specification for maximum number of authentication attempts where 'n' is between 1 and compile time option MAX_AUTH_TRIES. A default number of tries can be specified at compile time using 'DEFAULT_AUTH_TRIES' which itself defaults to MAX_AUTH_TRIES for backwards compatibility. Signed-off-by: Kevin Darbyshire-Bryant <[email protected]>
author Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
date Mon, 29 May 2017 10:25:09 +0100
parents 750ec4ec4cbe
children 4afde04f0607 06d52bcb8094
comparison
equal deleted inserted replaced
1438:4f8eb331174f 1442:517c67cbcd31
360 delay = 250000 + (delay % 100000); 360 delay = 250000 + (delay % 100000);
361 usleep(delay); 361 usleep(delay);
362 ses.authstate.failcount++; 362 ses.authstate.failcount++;
363 } 363 }
364 364
365 if (ses.authstate.failcount >= MAX_AUTH_TRIES) { 365 if (ses.authstate.failcount >= svr_opts.maxauthtries) {
366 char * userstr; 366 char * userstr;
367 /* XXX - send disconnect ? */ 367 /* XXX - send disconnect ? */
368 TRACE(("Max auth tries reached, exiting")) 368 TRACE(("Max auth tries reached, exiting"))
369 369
370 if (ses.authstate.pw_name == NULL) { 370 if (ses.authstate.pw_name == NULL) {