2008-04-27 06:10:09 +05:30
|
|
|
/*
|
2021-12-05 21:05:27 +05:30
|
|
|
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
|
|
|
|
* SPDX-FileCopyrightText: 1997 - 2000, Marek Michałkiewicz
|
|
|
|
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
|
|
|
|
* SPDX-FileCopyrightText: 2008 - 2009, Nicolas François
|
2008-04-27 06:10:09 +05:30
|
|
|
*
|
2021-12-05 21:05:27 +05:30
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2008-04-27 06:10:09 +05:30
|
|
|
*/
|
|
|
|
|
2007-11-11 05:16:11 +05:30
|
|
|
/* $Id$ */
|
2007-10-07 17:14:02 +05:30
|
|
|
#ifndef _FAILURE_H_
|
|
|
|
#define _FAILURE_H_
|
|
|
|
|
|
|
|
#include "defines.h"
|
|
|
|
#include "faillog.h"
|
2009-04-29 00:49:33 +05:30
|
|
|
#ifdef USE_UTMPX
|
2007-10-07 17:16:25 +05:30
|
|
|
#include <utmpx.h>
|
2009-04-29 00:49:33 +05:30
|
|
|
#else /* !USE_UTMPX */
|
2007-10-07 17:14:02 +05:30
|
|
|
#include <utmp.h>
|
2009-04-29 00:49:33 +05:30
|
|
|
#endif /* !USE_UTMPX */
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
/*
|
|
|
|
* failure - make failure entry
|
|
|
|
*
|
|
|
|
* failure() creates a new (struct faillog) entry or updates an
|
|
|
|
* existing one with the current failed login information.
|
|
|
|
*/
|
2007-10-07 17:16:07 +05:30
|
|
|
extern void failure (uid_t, const char *, struct faillog *);
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
/*
|
|
|
|
* failcheck - check for failures > allowable
|
|
|
|
*
|
|
|
|
* failcheck() is called AFTER the password has been validated. If the
|
|
|
|
* account has been "attacked" with too many login failures, failcheck()
|
|
|
|
* returns FALSE to indicate that the login should be denied even though
|
|
|
|
* the password is valid.
|
|
|
|
*/
|
2008-05-26 04:24:20 +05:30
|
|
|
extern int failcheck (uid_t uid, struct faillog *fl, bool failed);
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
/*
|
|
|
|
* failprint - print line of failure information
|
|
|
|
*
|
|
|
|
* failprint takes a (struct faillog) entry and formats it into a
|
|
|
|
* message which is displayed at login time.
|
|
|
|
*/
|
2007-10-07 17:16:07 +05:30
|
|
|
extern void failprint (const struct faillog *);
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
/*
|
2017-10-23 00:03:13 +05:30
|
|
|
* failtmp - update the cumulative failure log
|
2007-10-07 17:14:02 +05:30
|
|
|
*
|
|
|
|
* failtmp updates the (struct utmp) formatted failure log which
|
|
|
|
* maintains a record of all login failures.
|
|
|
|
*/
|
2009-04-29 00:49:33 +05:30
|
|
|
#ifdef USE_UTMPX
|
2009-04-20 17:07:41 +05:30
|
|
|
extern void failtmp (const char *username, const struct utmpx *);
|
2009-04-29 00:49:33 +05:30
|
|
|
#else /* !USE_UTMPX */
|
2009-04-20 17:07:41 +05:30
|
|
|
extern void failtmp (const char *username, const struct utmp *);
|
2009-04-29 00:49:33 +05:30
|
|
|
#endif /* !USE_UTMPX */
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
#endif
|
2008-04-27 06:10:09 +05:30
|
|
|
|