DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

smp_audit_fail(S)


smp_audit_fail -- write audit record

Syntax

cc . . . -lprot
#include <sys/types.h>
#include <prot.h>

void smp_audit_fail(usrp) struct smp_user_info *usrp;

Description

smp_audit_fail writes an audit record based on the return value of a failing routine. Records are written using the routines audit_login(S) and audit_passwd(S), which are used, respectively, to indicate a failed login or password change. It should be called when a value returned by one of the other SMP routines indicates that the program should not continue with either the login or the password change but before the program itself exits.

When an audit record is written the last unsuccessful login or password change time is written. In the case of a failed login, the failed login count is also written, both for the user and the terminal.

usrp points to a smp_user_info structure which has been created by the previous call to smp_check_user. Storage which may have been previously allocated for an old password is cleared. Then the value stored previously as the result is used to determine the type of audit record to be written.

Return values

smp_audit_fail does not return a value.

Diagnostics

smp_audit_fail produces no diagnostic messages.

Examples

The following example illustrates the usage of smp_audit_fail :
   ...
   switch (smp_check_user(SMP_LOGIN, gets(line), ttyname(0), 0, &usrp,
                                 &pwtries, &reason)) {
   ...
   case SMP_TERMLOCK:
        put("terminal locked\n");
        smp_audit_fail(usrp);
        exit(1);
   ...
   case SMP_RETIRED:
        put("account retired\n");
        smp_audit_fail(usrp);
        exit(1);
   ...
   }

Files


/lib/libprot.a
security subsystem library routines

/usr/lib/libp/libprot.a
as above but used for profiling

/usr/include/prot.h
defines the smp_user_info structure

/dev/auditw
audit interface device, see audit(HW)

See also

smp_check_user(S), smp_check_pw(S), smp_generate_pw(S), smp_get_messages(S), smp_pw_change(S), smp_pw_choice(S), smp_set_identity(S), smp_set_pw(S), smp_try_pw(S)

Standards conformance

smp_audit_fail is not part of any currently supported standard; it is an extension of AT&T System V provided by The Santa Cruz Operation, Inc.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003