2007-10-07 17:16:25 +05:30
|
|
|
/* $Id: failure.h,v 1.4 2005/06/10 18:35:17 kloczek Exp $ */
|
2007-10-07 17:14:02 +05:30
|
|
|
#ifndef _FAILURE_H_
|
|
|
|
#define _FAILURE_H_
|
|
|
|
|
|
|
|
#include "defines.h"
|
|
|
|
#include "faillog.h"
|
2007-10-07 17:16:25 +05:30
|
|
|
#ifdef HAVE_UTMPX_H
|
|
|
|
#include <utmpx.h>
|
|
|
|
#else
|
2007-10-07 17:14:02 +05:30
|
|
|
#include <utmp.h>
|
2007-10-07 17:16:25 +05:30
|
|
|
#endif
|
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.
|
|
|
|
*/
|
2007-10-07 17:16:07 +05:30
|
|
|
extern int failcheck (uid_t, struct faillog *, int);
|
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
|
|
|
|
|
|
|
/*
|
|
|
|
* failtmp - update the cummulative failure log
|
|
|
|
*
|
|
|
|
* failtmp updates the (struct utmp) formatted failure log which
|
|
|
|
* maintains a record of all login failures.
|
|
|
|
*/
|
2007-10-07 17:16:25 +05:30
|
|
|
#ifdef HAVE_UTMPX_H
|
|
|
|
extern void failtmp (const struct utmpx *);
|
|
|
|
#else
|
2007-10-07 17:16:07 +05:30
|
|
|
extern void failtmp (const struct utmp *);
|
2007-10-07 17:16:25 +05:30
|
|
|
#endif
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
#endif
|