PERFORCE change 58505 for review
Wayne Salamon
wsalamon at FreeBSD.org
Thu Jul 29 23:41:34 GMT 2004
http://perforce.freebsd.org/chv.cgi?CH=58505
Change 58505 by wsalamon at wsalamon_epi on 2004/07/29 23:41:28
Call the audit system call enter/exit routines when a system call is
entered/exited. Fix the Makefile for the auditreduce and praudit
commands, fix up the #includes in these source files.
Affected files ...
.. //depot/projects/trustedbsd/audit3/contrib/bsm/bin/Makefile#2 edit
.. //depot/projects/trustedbsd/audit3/contrib/bsm/bin/auditreduce.c#2 edit
.. //depot/projects/trustedbsd/audit3/contrib/bsm/bin/praudit.c#2 edit
.. //depot/projects/trustedbsd/audit3/sys/bsm/audit_kernel.h#4 edit
.. //depot/projects/trustedbsd/audit3/sys/i386/i386/trap.c#2 edit
Differences ...
==== //depot/projects/trustedbsd/audit3/contrib/bsm/bin/Makefile#2 (text+ko) ====
@@ -1,28 +1,13 @@
-## Probably only works with GNU make
+#
+# Makefile for the praudit and auditreduce commands.
+#
-ifndef CFLAGS
-CFLAGS = -g -Wall -pipe -fno-common -I/usr/include $(CCFLAGS)
-endif
-BINCFLAGS = $(CFLAGS) -I../lib
-BSMLIBPATH = -L../lib -L/usr/lib
-GCC=gcc
+CFLAGS = -I. -lbsm
+CFILES = praudit.c auditreduce.c auditreduce.h
+DSTROOT = /usr/sbin
-OUTFILES = praudit auditreduce
+all: praudit auditreduce
-all: ${OUTFILES}
-
-install: ${OUTFILES}
- for bin in ${OUTFILES} ; do \
- install $$bin /usr/sbin ; \
- /usr/bin/strip -S /usr/sbin/$$bin ; \
- done
-
-praudit: praudit.c
- $(GCC) $(BINCFLAGS) $(BSMLIBPATH) -lbsm praudit.c -o praudit
-
-auditreduce: auditreduce.c
- $(GCC) $(BINCFLAGS) $(BSMLIBPATH) -lbsm auditreduce.c -o auditreduce
-
-clean:
- rm -f *.o ${OUTFILES}
-
+install:
+ install -d $(DSTROOT)
+ install -c -m 544 auditreduce praudit $(DSTROOT)
==== //depot/projects/trustedbsd/audit3/contrib/bsm/bin/auditreduce.c#2 (text+ko) ====
@@ -49,7 +49,7 @@
#include <pwd.h>
#include <grp.h>
-#include <libbsm.h>
+#include <bsm/libbsm.h>
#include "auditreduce.h"
==== //depot/projects/trustedbsd/audit3/contrib/bsm/bin/praudit.c#2 (text+ko) ====
@@ -38,7 +38,7 @@
#include <stdlib.h>
#include <unistd.h>
-#include <libbsm.h>
+#include <bsm/libbsm.h>
extern char *optarg;
extern int optind, optopt, opterr,optreset;
==== //depot/projects/trustedbsd/audit3/sys/bsm/audit_kernel.h#4 (text+ko) ====
@@ -29,7 +29,6 @@
#include <bsm/audit.h>
#include <sys/sysctl.h>
-#include <sys/eventvar.h>
#include <sys/user.h>
/*
@@ -332,9 +331,9 @@
audit_arg_ ## op (args); \
} while (0)
-#define AUDIT_SYSCALL_ENTER(args...) do { \
+#define AUDIT_SYSCALL_ENTER(code, td) do { \
if (audit_enabled) { \
- audit_syscall_enter(args); \
+ audit_syscall_enter(code, td); \
} \
} while (0)
@@ -358,7 +357,7 @@
} while (0)
#else /* !AUDIT */
-#define AUDIT_SYSCALL_ENTER(args...) do { \
+#define AUDIT_SYSCALL_ENTER(code, td) do { \
} while (0)
#define AUDIT_SYSCALL_EXIT(error, td) do { \
==== //depot/projects/trustedbsd/audit3/sys/i386/i386/trap.c#2 (text+ko) ====
@@ -72,6 +72,9 @@
#ifdef KTRACE
#include <sys/ktrace.h>
#endif
+#ifdef AUDIT
+#include <bsm/audit_kernel.h>
+#endif
#include <vm/vm.h>
#include <vm/vm_param.h>
@@ -1001,7 +1004,9 @@
PTRACESTOP_SC(p, td, S_PT_SCE);
+ AUDIT_SYSCALL_ENTER(code, td);
error = (*callp->sy_call)(td, args);
+ AUDIT_SYSCALL_EXIT(error, td);
}
switch (error) {
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message
More information about the trustedbsd-cvs
mailing list