FreeBSD/contrib/openbsm/bin/auditd/auditd.c
/*
 * Create a new audit log trail file and swap with the current one, if any.
 */
Create a new audit log trail file and swap with the current one, if any.
Create a new audit log trail file and swap with the current one if any .
static int
do_trail_file(void)
{
	int err;
	err = auditd_read_dirs(audit_warn_soft, audit_warn_hard);
	if (err) {
		auditd_log_err("auditd_read_dirs(): %s",
		    auditd_strerror(err));
		if (err == ADE_HARDLIM)
			audit_warn_allhard();
		if (err != ADE_SOFTLIM)
			return (-1);
		else
			audit_warn_allsoft();
	}
	if (swap_audit_file() == -1) {
		return (-1);
	}
	err = auditd_expire_trails(audit_warn_expired);
	if (err)
		auditd_log_err("auditd_expire_trails(): %s",
		    auditd_strerror(err));
	return (0);
}
static int do_trail_file ( void ) { int err ; err = auditd_read_dirs ( audit_warn_soft , audit_warn_hard ) ; if ( err ) { auditd_log_err ( " " , auditd_strerror ( err ) ) ; if ( err == ADE_HARDLIM ) audit_warn_allhard ( ) ; if ( err != ADE_SOFTLIM ) return ( -1 ) ; else audit_warn_allsoft ( ) ; } if ( swap_audit_file ( ) == -1 ) { return ( -1 ) ; } err = auditd_expire_trails ( audit_warn_expired ) ; if ( err ) auditd_log_err ( " " , auditd_strerror ( err ) ) ; return ( 0 ) ; }
Create a new audit log trail file and swap with the current one, if any.
Create a new audit log trail file and swap with the current one if any .
/*
	 * First, refresh the list of audit log directories.
	 */ /* continue on with soft limit error */ /*
	 * Create a new file and swap with the one being used in kernel.
	 */ /*
		 * XXX Faulty directory listing? - user should be given
		 * XXX an opportunity to change the audit_control file
		 * XXX switch to a reduced mode of auditing?
		 */ /*
	 * Finally, see if there are any trail files to expire.
	 */