Deleted Added
full compact
login.c (155312) login.c (157215)
1/*-
2 * Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 * Copyright (c) 2002 Networks Associates Technologies, Inc.
5 * All rights reserved.
6 *
7 * Portions of this software were developed for the FreeBSD Project by
8 * ThinkSec AS and NAI Labs, the Security Research Division of Network

--- 31 unchanged lines hidden (view full) ---

40
41#if 0
42#ifndef lint
43static char sccsid[] = "@(#)login.c 8.4 (Berkeley) 4/2/94";
44#endif
45#endif
46
47#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 * Copyright (c) 2002 Networks Associates Technologies, Inc.
5 * All rights reserved.
6 *
7 * Portions of this software were developed for the FreeBSD Project by
8 * ThinkSec AS and NAI Labs, the Security Research Division of Network

--- 31 unchanged lines hidden (view full) ---

40
41#if 0
42#ifndef lint
43static char sccsid[] = "@(#)login.c 8.4 (Berkeley) 4/2/94";
44#endif
45#endif
46
47#include <sys/cdefs.h>
48__FBSDID("$FreeBSD: head/usr.bin/login/login.c 155312 2006-02-04 20:20:02Z wsalamon $");
48__FBSDID("$FreeBSD: head/usr.bin/login/login.c 157215 2006-03-28 15:30:42Z cognet $");
49
50/*
51 * login [ name ]
52 * login -h hostname (for telnetd, etc.)
53 * login -f name (for pre-authenticated login: datakit, xterm, etc.)
54 */
55
56#include <sys/copyright.h>

--- 281 unchanged lines hidden (view full) ---

338 * We are not exiting here, but this corresponds to a failed
339 * login event, so set exitstatus to 1.
340 */
341 au_login_fail("Login incorrect", 1);
342
343 (void)printf("Login incorrect\n");
344 failures++;
345
49
50/*
51 * login [ name ]
52 * login -h hostname (for telnetd, etc.)
53 * login -f name (for pre-authenticated login: datakit, xterm, etc.)
54 */
55
56#include <sys/copyright.h>

--- 281 unchanged lines hidden (view full) ---

338 * We are not exiting here, but this corresponds to a failed
339 * login event, so set exitstatus to 1.
340 */
341 au_login_fail("Login incorrect", 1);
342
343 (void)printf("Login incorrect\n");
344 failures++;
345
346 pwd = NULL;
347
346 /*
347 * Allow up to 'retry' (10) attempts, but start
348 * backing off after 'backoff' (3) attempts.
349 */
350 if (++cnt > backoff) {
351 if (cnt >= retries) {
352 badlogin(username);
353 bail(SLEEP_EXIT, 1);

--- 592 unchanged lines hidden (view full) ---

946/*
947 * Exit, optionally after sleeping a few seconds
948 */
949void
950bail(int sec, int eval)
951{
952
953 pam_cleanup();
348 /*
349 * Allow up to 'retry' (10) attempts, but start
350 * backing off after 'backoff' (3) attempts.
351 */
352 if (++cnt > backoff) {
353 if (cnt >= retries) {
354 badlogin(username);
355 bail(SLEEP_EXIT, 1);

--- 592 unchanged lines hidden (view full) ---

948/*
949 * Exit, optionally after sleeping a few seconds
950 */
951void
952bail(int sec, int eval)
953{
954
955 pam_cleanup();
954 audit_logout();
956 if (pwd != NULL)
957 audit_logout();
955 (void)sleep(sec);
956 exit(eval);
957}
958 (void)sleep(sec);
959 exit(eval);
960}