PR/23616: Christian Biere: login might not back-off as expected

This commit is contained in:
jnemeth 2006-03-08 03:09:04 +00:00
parent 2e3c4f59d7
commit 1a6a87b59b
1 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: login_pam.c,v 1.13 2006/03/06 23:06:18 jnemeth Exp $ */
/* $NetBSD: login_pam.c,v 1.14 2006/03/08 03:09:04 jnemeth Exp $ */
/*-
* Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994
@ -40,7 +40,7 @@ __COPYRIGHT(
#if 0
static char sccsid[] = "@(#)login.c 8.4 (Berkeley) 4/2/94";
#endif
__RCSID("$NetBSD: login_pam.c,v 1.13 2006/03/06 23:06:18 jnemeth Exp $");
__RCSID("$NetBSD: login_pam.c,v 1.14 2006/03/08 03:09:04 jnemeth Exp $");
#endif /* not lint */
/*
@ -416,14 +416,18 @@ skip_auth:
(void)printf("Login incorrect or refused on this terminal.\n");
failures++;
cnt++;
/* we allow 10 tries, but after 3 we start backing off */
/*
* We allow login_retries tries, but after login_backoff
* we start backing off. These default to 10 and 3
* respectively.
*/
if (cnt > login_backoff) {
if (cnt >= login_retries) {
badlogin(username);
pam_end(pamh, PAM_SUCCESS);
sleepexit(EXIT_FAILURE);
}
sleep((u_int)((cnt - 3) * 5));
sleep((u_int)((cnt - login_backoff) * 5));
}
}