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 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 |
346 pwd = NULL; 347 |
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(); |
956 if (pwd != NULL) 957 audit_logout(); |
958 (void)sleep(sec); 959 exit(eval); 960} |