FreeBSD/contrib/openbsm/bin/auditd/auditd.c
/*
 * Close all log files, control files, and tell the audit system.
 */
Close all log files, control files, and tell the audit system.
Close all log files control files and tell the audit system .
static int
close_all(void)
{
	int err_ret = 0;
	char TS[TIMESTAMP_LEN + 1];
	int err;
	int cond;
	time_t tt;
	err = auditd_gen_record(AUE_audit_shutdown, NULL);
	if (err)
		auditd_log_err("auditd_gen_record(AUE_audit_shutdown) %s: %m",
		    auditd_strerror(err));
	cond = AUC_DISABLED;
	err_ret = audit_set_cond(&cond);
	if (err_ret != 0) {
		auditd_log_err("Disabling audit failed! : %s", strerror(errno));
		err_ret = 1;
	}
	auditd_set_state(AUD_STATE_DISABLED);
	if (getTSstr(tt, TS, sizeof(TS)) == 0)
		close_lastfile(TS);
	if (lastfile != NULL)
		free(lastfile);
	err_ret += close_misc();
	if (err_ret) {
		auditd_log_err("Could not unregister");
		audit_warn_postsigterm();
	}
	auditd_log_info("Finished");
	return (err_ret);
}
static int close_all ( void ) { int err_ret = 0 ; char TS [ TIMESTAMP_LEN + 1 ] ; int err ; int cond ; time_t tt ; err = auditd_gen_record ( AUE_audit_shutdown , NULL ) ; if ( err ) auditd_log_err ( " " , auditd_strerror ( err ) ) ; cond = AUC_DISABLED ; err_ret = audit_set_cond ( & cond ) ; if ( err_ret != 0 ) { auditd_log_err ( " " , strerror ( errno ) ) ; err_ret = 1 ; } auditd_set_state ( AUD_STATE_DISABLED ) ; if ( getTSstr ( tt , TS , sizeof ( TS ) ) == 0 ) close_lastfile ( TS ) ; if ( lastfile != NULL ) free ( lastfile ) ; err_ret += close_misc ( ) ; if ( err_ret ) { auditd_log_err ( " " ) ; audit_warn_postsigterm ( ) ; } auditd_log_info ( " " ) ; return ( err_ret ) ; }
Close all log files, control files, and tell the audit system.
Close all log files control files and tell the audit system .
/* Flush contents. */ /*
	 * Updated the cached state that auditing has been disabled.
	 */