FreeBSD/contrib/openbsm/libauditd/auditd_lib.c
/*
 * Set the audit control policy if a policy is configured in audit_control(5),
 * implement the policy. However, if one isn't defined or if there is an error
 * parsing the control file, set AUDIT_CNT to avoid leaving the system in a
 * fragile state.  Return:
 *	ADE_NOERR	on success,
 *	ADE_PARSE	error parsing audit_control(5),
 *	ADE_AUDITON	error setting policy using auditon(2).
 */
Set the audit control policy if a policy is configured in audit_control(5),
implement the policy. However, if one isn't defined or if there is an error
parsing the control file, set AUDIT_CNT to avoid leaving the system in a
fragile state.  Return:
ADE_NOERR       on success,
ADE_PARSE       error parsing audit_control(5),
ADE_AUDITON     error setting policy using auditon(2).
Set the audit control policy if a policy is configured in audit_control ( 5 ) implement the policy . However if one isn ' t defined or if there is an error parsing the control file set AUDIT_CNT to avoid leaving the system in a fragile state . Return : ADE_NOERR on success ADE_PARSE error parsing audit_control ( 5 ) ADE_AUDITON error setting policy using auditon ( 2 ) .
int
auditd_set_policy(void)
{
	int policy;
	char polstr[POL_STR_SIZE];
	if (getacpol(polstr, POL_STR_SIZE) != 0 ||
	    au_strtopol(polstr, &policy) != 0) {
		policy = AUDIT_CNT;
		if (audit_set_policy(&policy) != 0)
			return (ADE_AUDITON);
		return (ADE_PARSE);
	}
	if (audit_set_policy(&policy) != 0)
		return (ADE_AUDITON);
	return (ADE_NOERR);
}
int auditd_set_policy ( void ) { int policy ; char polstr [ POL_STR_SIZE ] ; if ( getacpol ( polstr , POL_STR_SIZE ) != 0 || au_strtopol ( polstr , & policy ) != 0 ) { policy = AUDIT_CNT ; if ( audit_set_policy ( & policy ) != 0 ) return ( ADE_AUDITON ) ; return ( ADE_PARSE ) ; } if ( audit_set_policy ( & policy ) != 0 ) return ( ADE_AUDITON ) ; return ( ADE_NOERR ) ; }
Set the audit control policy if a policy is configured in audit_control(5),
 implement the policy.
Set the audit control policy if a policy is configured in audit_control ( 5 ) implement the policy .