PERFORCE change 90760 for review
Robert Watson
rwatson at FreeBSD.org
Mon Jan 30 17:43:57 PST 2006
http://perforce.freebsd.org/chv.cgi?CH=90760
Change 90760 by rwatson at rwatson_peppercorn on 2006/01/31 01:43:27
Just when you think it's style(9), you remember about trailing
white space.
Affected files ...
.. //depot/projects/trustedbsd/openbsm/bin/auditd/audit_warn.c#5 edit
.. //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.8#4 edit
.. //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.c#5 edit
.. //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.h#4 edit
Differences ...
==== //depot/projects/trustedbsd/openbsm/bin/auditd/audit_warn.c#5 (text+ko) ====
@@ -3,20 +3,20 @@
* All rights reserved.
*
* @APPLE_BSD_LICENSE_HEADER_START@
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
+ * from this software without specific prior written permission.
+ *
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -27,10 +27,10 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* @APPLE_BSD_LICENSE_HEADER_END@
*
- * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/audit_warn.c#4 $
+ * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/audit_warn.c#5 $
*/
#include <sys/types.h>
@@ -44,7 +44,7 @@
*/
static int
auditwarnlog(char *args[])
-{
+{
char *loc_args[9];
pid_t pid;
int i;
@@ -53,7 +53,7 @@
for (i = 0; args[i] != NULL && i < 8; i++)
loc_args[i+1] = args[i];
loc_args[i+1] = NULL;
-
+
pid = fork();
if (pid == -1)
return (-1);
@@ -81,11 +81,11 @@
{
char intstr[12];
char *args[3];
-
- snprintf(intstr, 12, "%d", count);
+
+ snprintf(intstr, 12, "%d", count);
args[0] = HARDLIM_ALL_WARN;
- args[1] = intstr;
+ args[1] = intstr;
args[2] = NULL;
return (auditwarnlog(args));
@@ -98,7 +98,7 @@
audit_warn_allsoft(void)
{
char *args[2];
-
+
args[0] = SOFTLIM_ALL_WARN;
args[1] = NULL;
@@ -115,7 +115,7 @@
audit_warn_auditoff(void)
{
char *args[2];
-
+
args[0] = AUDITOFF_WARN;
args[1] = NULL;
@@ -129,7 +129,7 @@
audit_warn_ebusy(void)
{
char *args[2];
-
+
args[0] = EBUSY_WARN;
args[1] = NULL;
@@ -147,9 +147,9 @@
audit_warn_getacdir(char *filename)
{
char *args[3];
-
+
args[0] = GETACDIR_WARN;
- args[1] = filename;
+ args[1] = filename;
args[2] = NULL;
return (auditwarnlog(args));
@@ -162,9 +162,9 @@
audit_warn_hard(char *filename)
{
char *args[3];
-
+
args[0] = HARDLIM_WARN;
- args[1] = filename;
+ args[1] = filename;
args[2] = NULL;
return (auditwarnlog(args));
@@ -177,7 +177,7 @@
audit_warn_nostart(void)
{
char *args[2];
-
+
args[0] = NOSTART_WARN;
args[1] = NULL;
@@ -192,7 +192,7 @@
audit_warn_postsigterm(void)
{
char *args[2];
-
+
args[0] = POSTSIGTERM_WARN;
args[1] = NULL;
@@ -206,9 +206,9 @@
audit_warn_soft(char *filename)
{
char *args[3];
-
+
args[0] = SOFTLIM_WARN;
- args[1] = filename;
+ args[1] = filename;
args[2] = NULL;
return (auditwarnlog(args));
@@ -222,7 +222,7 @@
audit_warn_tmpfile(void)
{
char *args[2];
-
+
args[0] = TMPFILE_WARN;
args[1] = NULL;
==== //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.8#4 (text+ko) ====
@@ -2,20 +2,20 @@
.\" All rights reserved.
.\"
.\" @APPLE_BSD_LICENSE_HEADER_START@
-.\"
+.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
-.\"
+.\"
.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
+.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
+.\" documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
.\" its contributors may be used to endorse or promote products derived
-.\" from this software without specific prior written permission.
-.\"
+.\" from this software without specific prior written permission.
+.\"
.\" THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -26,10 +26,10 @@
.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-.\"
+.\"
.\" @APPLE_BSD_LICENSE_HEADER_END@
.\"
-.\" $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.8#3 $
+.\" $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.8#4 $
.\"
.Dd Jan 24, 2004
.Dt AUDITD 8
@@ -42,7 +42,7 @@
.Op Fl dhs
.Sh DESCRIPTION
The
-.Nm
+.Nm
daemon responds to requests from the audit(1) utility and notifications
from the kernel. It manages the resulting audit log files and specified
log file locations.
==== //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.c#5 (text+ko) ====
@@ -3,20 +3,20 @@
* All rights reserved.
*
* @APPLE_BSD_LICENSE_HEADER_START@
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
+ * from this software without specific prior written permission.
+ *
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -27,10 +27,10 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* @APPLE_BSD_LICENSE_HEADER_END@
*
- * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.c#4 $
+ * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.c#5 $
*/
#include <sys/dirent.h>
@@ -84,7 +84,7 @@
{
struct dir_ent *dirent;
- while ((dirent = TAILQ_FIRST(&dir_q))) {
+ while ((dirent = TAILQ_FIRST(&dir_q))) {
TAILQ_REMOVE(&dir_q, dirent, dirs);
free(dirent->dirname);
free(dirent);
@@ -114,7 +114,7 @@
* XXX We should affix the hostname also
*/
static char *
-affixdir(char *name, struct dir_ent *dirent)
+affixdir(char *name, struct dir_ent *dirent)
{
char *fn;
char *curdir;
@@ -149,7 +149,7 @@
/* Rename the last file -- append timestamp. */
if ((ptr = strstr(lastfile, NOT_TERMINATED)) != NULL) {
- *ptr = '.';
+ *ptr = '.';
strcpy(ptr+1, TS);
if (rename(oldname, lastfile) != 0)
syslog(LOG_ERR, "Could not rename %s to %s \n",
@@ -158,7 +158,7 @@
syslog(LOG_INFO, "renamed %s to %s \n",
oldname, lastfile);
}
- free(lastfile);
+ free(lastfile);
free(oldname);
lastfile = NULL;
}
@@ -186,7 +186,7 @@
/* Try until we succeed. */
while ((dirent = TAILQ_FIRST(&dir_q))) {
if ((fn = affixdir(timestr, dirent)) == NULL) {
- syslog(LOG_INFO, "Failed to swap log at time %s\n",
+ syslog(LOG_INFO, "Failed to swap log at time %s\n",
timestr);
return (-1);
}
@@ -201,11 +201,11 @@
perror("File open");
else if (auditctl(fn) != 0) {
syslog(LOG_ERR,
- "auditctl failed setting log file! : %s\n",
+ "auditctl failed setting log file! : %s\n",
strerror(errno));
close(fd);
} else {
- /* Success. */
+ /* Success. */
close_lastfile(TS);
lastfile = fn;
close(fd);
@@ -214,7 +214,7 @@
/*
* Tell the administrator about lack of permissions for dir.
- */
+ */
audit_warn_getacdir(dirent->dirname);
/* Try again with a different directory. */
@@ -264,10 +264,10 @@
allhardcount = 0;
if (swap_audit_file() == -1) {
- syslog(LOG_ERR, "Could not swap audit file\n");
+ syslog(LOG_ERR, "Could not swap audit file\n");
/*
- * XXX Faulty directory listing? - user should be given
- * XXX an opportunity to change the audit_control file
+ * 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?
*/
return (-1);
@@ -276,7 +276,7 @@
/*
* XXX There are synchronization problems here
* XXX what should we do if a trigger for the earlier limit
- * XXX is generated here?
+ * XXX is generated here?
*/
if (0 == (ret = getacmin(&minval))) {
syslog(LOG_INFO, "min free = %d\n", minval);
@@ -286,8 +286,8 @@
return (-1);
}
qctrl.aq_minfree = minval;
- if (auditon(A_SETQCTRL, &qctrl, sizeof(qctrl)) != 0) {
- syslog(LOG_ERR,
+ if (auditon(A_SETQCTRL, &qctrl, sizeof(qctrl)) != 0) {
+ syslog(LOG_ERR,
"could not set audit queue settings\n");
return (-1);
}
@@ -300,7 +300,7 @@
* Close all log files, control files, and tell the audit system.
*/
static int
-close_all(void)
+close_all(void)
{
int err_ret = 0;
char TS[POSTFIX_LEN];
@@ -323,7 +323,7 @@
cond = AUC_DISABLED;
err_ret = auditon(A_SETCOND, &cond, sizeof(cond));
if (err_ret != 0) {
- syslog(LOG_ERR, "Disabling audit failed! : %s\n",
+ syslog(LOG_ERR, "Disabling audit failed! : %s\n",
strerror(errno));
err_ret = 1;
}
@@ -371,18 +371,18 @@
/* Set up the signal hander. */
if (signal(SIGTERM, relay_signal) == SIG_ERR) {
- syslog(LOG_ERR,
+ syslog(LOG_ERR,
"Could not set signal handler for SIGTERM\n");
fail_exit();
}
if (signal(SIGCHLD, relay_signal) == SIG_ERR) {
- syslog(LOG_ERR,
+ syslog(LOG_ERR,
"Could not set signal handler for SIGCHLD\n");
fail_exit();
}
if ((pidfile = fopen(AUDITD_PIDFILE, "a")) == NULL) {
- syslog(LOG_ERR,
+ syslog(LOG_ERR,
"Could not open PID file\n");
audit_warn_tmpfile();
return (-1);
@@ -391,7 +391,7 @@
/* Attempt to lock the pid file; if a lock is present, exit. */
fd = fileno(pidfile);
if (flock(fd, LOCK_EX | LOCK_NB) < 0) {
- syslog(LOG_ERR,
+ syslog(LOG_ERR,
"PID file is locked (is another auditd running?).\n");
audit_warn_ebusy();
return (-1);
@@ -423,7 +423,7 @@
int rc;
/*
- * Suppres duplicate messages from the kernel within the specified
+ * Suppres duplicate messages from the kernel within the specified
* interval.
*/
struct timeval ts;
@@ -432,17 +432,17 @@
if (gettimeofday(&ts, &tzp) == 0) {
tt = (time_t)ts.tv_sec;
- if ((trigger == last_trigger) &&
+ if ((trigger == last_trigger) &&
(tt < (last_time + DUPLICATE_INTERVAL)))
return;
last_trigger = trigger;
last_time = tt;
}
- /*
+ /*
* Message processing is done here.
*/
- dirent = TAILQ_FIRST(&dir_q);
+ dirent = TAILQ_FIRST(&dir_q);
switch(trigger) {
case AUDIT_TRIGGER_LOW_SPACE:
@@ -453,12 +453,12 @@
TAILQ_INSERT_TAIL(&dir_q, dirent, dirs);
audit_warn_soft(dirent->dirname);
dirent->softlim = 1;
-
- if (TAILQ_NEXT(TAILQ_FIRST(&dir_q), dirs) != NULL &&
+
+ if (TAILQ_NEXT(TAILQ_FIRST(&dir_q), dirs) != NULL &&
swap_audit_file() == -1)
syslog(LOG_ERR, "Error swapping audit file\n");
- /*
+ /*
* Check if the next dir has already reached its soft
* limit.
*/
@@ -468,7 +468,7 @@
audit_warn_allsoft();
}
} else {
- /*
+ /*
* Continue auditing to the current file. Also
* generate an allsoft warning.
* XXX do we want to do this ?
@@ -487,7 +487,7 @@
free(dirent);
if (swap_audit_file() == -1)
- syslog(LOG_ERR, "Error swapping audit file\n");
+ syslog(LOG_ERR, "Error swapping audit file\n");
/* We are out of log directories. */
audit_warn_allhard(++allhardcount);
@@ -500,7 +500,7 @@
*/
syslog(LOG_INFO, "Got open new trigger\n");
if (swap_audit_file() == -1)
- syslog(LOG_ERR, "Error swapping audit file\n");
+ syslog(LOG_ERR, "Error swapping audit file\n");
break;
case AUDIT_TRIGGER_READ_FILE:
@@ -535,7 +535,7 @@
return (-1);
}
syslog(LOG_INFO, "%s: read %d\n", __FUNCTION__, trigger);
- if (trigger == AUDIT_TRIGGER_CLOSE_AND_DIE)
+ if (trigger == AUDIT_TRIGGER_CLOSE_AND_DIE)
break;
else
handle_audit_trigger(trigger);
@@ -558,7 +558,7 @@
syslog(LOG_INFO, "warn process [pid=%d] %s %d.\n", child,
((WIFEXITED(wstatus)) ? "exited with non-zero status" :
"exited as a result of signal"),
- ((WIFEXITED(wstatus)) ? WEXITSTATUS(wstatus) :
+ ((WIFEXITED(wstatus)) ? WEXITSTATUS(wstatus) :
WTERMSIG(wstatus)));
}
}
@@ -597,7 +597,7 @@
evc_map.ec_class = evp->ae_class;
if (auditon(A_SETCLASS, &evc_map, sizeof(au_evclass_map_t))
!= 0)
- syslog(LOG_ERR,
+ syslog(LOG_ERR,
"Failed to register class mapping for event %s",
evp->ae_name);
else
@@ -707,7 +707,7 @@
openlog("auditd", LOG_CONS | LOG_PID, LOG_SECURITY);
syslog(LOG_INFO, "starting...\n");
- if (debug == 0 && daemon(0, 0) == -1) {
+ if (debug == 0 && daemon(0, 0) == -1) {
syslog(LOG_ERR, "Failed to daemonize\n");
exit(1);
}
==== //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.h#4 (text+ko) ====
@@ -3,20 +3,20 @@
* All rights reserved.
*
* @APPLE_BSD_LICENSE_HEADER_START@
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
+ * from this software without specific prior written permission.
+ *
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -27,24 +27,24 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* @APPLE_BSD_LICENSE_HEADER_END@
*
- * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.h#3 $
+ * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.h#4 $
*/
#ifndef _AUDITD_H_
-#define _AUDITD_H_
+#define _AUDITD_H_
#include <sys/types.h>
#include <sys/queue.h>
#include <syslog.h>
-#define MAX_DIR_SIZE 255
-#define AUDITD_NAME "auditd"
+#define MAX_DIR_SIZE 255
+#define AUDITD_NAME "auditd"
-#define POSTFIX_LEN 16
-#define NOT_TERMINATED ".not_terminated"
+#define POSTFIX_LEN 16
+#define NOT_TERMINATED ".not_terminated"
struct dir_ent {
char *dirname;
@@ -52,19 +52,19 @@
TAILQ_ENTRY(dir_ent) dirs;
};
-#define HARDLIM_ALL_WARN "allhard"
-#define SOFTLIM_ALL_WARN "allsoft"
-#define AUDITOFF_WARN "aditoff"
-#define EBUSY_WARN "ebusy"
-#define GETACDIR_WARN "getacdir"
-#define HARDLIM_WARN "hard"
-#define NOSTART_WARN "nostart"
-#define POSTSIGTERM_WARN "postsigterm"
-#define SOFTLIM_WARN "soft"
-#define TMPFILE_WARN "tmpfile"
+#define HARDLIM_ALL_WARN "allhard"
+#define SOFTLIM_ALL_WARN "allsoft"
+#define AUDITOFF_WARN "aditoff"
+#define EBUSY_WARN "ebusy"
+#define GETACDIR_WARN "getacdir"
+#define HARDLIM_WARN "hard"
+#define NOSTART_WARN "nostart"
+#define POSTSIGTERM_WARN "postsigterm"
+#define SOFTLIM_WARN "soft"
+#define TMPFILE_WARN "tmpfile"
-#define AUDITWARN_SCRIPT "/etc/security/audit_warn"
-#define AUDITD_PIDFILE "/var/run/auditd.pid"
+#define AUDITWARN_SCRIPT "/etc/security/audit_warn"
+#define AUDITD_PIDFILE "/var/run/auditd.pid"
int audit_warn_allhard(int count);
int audit_warn_allsoft(void);
More information about the p4-projects
mailing list