- if (++cnt >= 5) {
- if (hostname)
- syslog(LOG_ERR,
- "REPEATED LOGIN FAILURES ON %s FROM %.*s, %.*s",
- tty, UT_HOSTSIZE, hostname, UT_NAMESIZE,
- username);
- else
- syslog(LOG_ERR,
- "REPEATED LOGIN FAILURES ON %s, %.*s",
- tty, UT_NAMESIZE, username);
- (void)ioctl(0, TIOCHPCL, (struct sgttyb *)NULL);
- sleepexit(1);
+ /* we allow 10 tries, but after 3 we start backing off */
+ if (++cnt > 3) {
+ if (cnt >= 10) {
+ badlogin(username);
+ (void)ioctl(0, TIOCHPCL, (struct sgttyb *)NULL);
+ sleepexit(1);
+ }
+ sleep((u_int)((cnt - 3) * 5));