From owner-p4-projects@FreeBSD.ORG Tue Jan 31 01:26:32 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9CB9016A423; Tue, 31 Jan 2006 01:26:31 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5100916A420 for ; Tue, 31 Jan 2006 01:26:31 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id EF38043D45 for ; Tue, 31 Jan 2006 01:26:30 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0V1QUf4082273 for ; Tue, 31 Jan 2006 01:26:30 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0V1QUTE082270 for perforce@freebsd.org; Tue, 31 Jan 2006 01:26:30 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Tue, 31 Jan 2006 01:26:30 GMT Message-Id: <200601310126.k0V1QUTE082270@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90754 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2006 01:26:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=90754 Change 90754 by rwatson@rwatson_peppercorn on 2006/01/31 01:25:44 A few missed instances that required style(9). Staticize one more function. This file is really long. Affected files ... .. //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.c#3 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.c#3 (text+ko) ==== @@ -53,15 +53,15 @@ #include #include "auditd.h" -#define NA_EVENT_STR_SIZE 25 -static int ret, minval; -static char *lastfile = NULL; +#define NA_EVENT_STR_SIZE 25 -static int allhardcount = 0; -static int triggerfd = 0; +static int ret, minval; +static char *lastfile = NULL; +static int allhardcount = 0; +static int triggerfd = 0; -static TAILQ_HEAD(, dir_ent) dir_q; +static TAILQ_HEAD(, dir_ent) dir_q; /* * Error starting auditd @@ -297,7 +297,8 @@ /* * Close all log files, control files, and tell the audit system. */ -int close_all() +static int +close_all(void) { int err_ret = 0; char TS[POSTFIX_LEN]; @@ -305,31 +306,27 @@ token_t *tok; long cond; - /* Generate an audit record */ - if ((aufd = au_open()) == -1) { + /* Generate an audit record. */ + if ((aufd = au_open()) == -1) syslog(LOG_ERR, "Could not create audit shutdown event.\n"); - } else { - - if ((tok = au_to_text("auditd::Audit shutdown")) != NULL) { + else { + if ((tok = au_to_text("auditd::Audit shutdown")) != NULL) au_write(aufd, tok); - } - - if (au_close(aufd, 1, AUE_audit_shutdown) == -1) { - syslog(LOG_ERR, "Could not close audit shutdown event.\n"); - } + if (au_close(aufd, 1, AUE_audit_shutdown) == -1) + syslog(LOG_ERR, + "Could not close audit shutdown event.\n"); } - /* flush contents */ + /* Flush contents. */ cond = AUC_DISABLED; err_ret = auditon(A_SETCOND, &cond, sizeof(cond)); if (err_ret != 0) { syslog(LOG_ERR, "Disabling audit failed! : %s\n", - strerror(errno)); + strerror(errno)); err_ret = 1; } - if (getTSstr(TS, POSTFIX_LEN) == 0) { + if (getTSstr(TS, POSTFIX_LEN) == 0) close_lastfile(TS); - } if (lastfile != NULL) free(lastfile); @@ -341,9 +338,8 @@ } endac(); - if (close(triggerfd) != 0) { + if (close(triggerfd) != 0) syslog(LOG_ERR, "Error closing control file\n"); - } syslog(LOG_INFO, "Finished.\n"); return (0); } @@ -415,7 +411,7 @@ * enough to time to rotate log files without thrashing from soft warnings * generated before the log is actually rotated. */ -#define DUPLICATE_INTERVAL 30 +#define DUPLICATE_INTERVAL 30 static void handle_audit_trigger(int trigger) {