From owner-p4-projects@FreeBSD.ORG Thu Jul 29 23:41:35 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2717516A4D0; Thu, 29 Jul 2004 23:41:35 +0000 (GMT) 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 D979016A4CE for ; Thu, 29 Jul 2004 23:41:34 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BD93643D1D for ; Thu, 29 Jul 2004 23:41:34 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i6TNfYRW060541 for ; Thu, 29 Jul 2004 23:41:34 GMT (envelope-from wsalamon@computer.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i6TNfY2d060538 for perforce@freebsd.org; Thu, 29 Jul 2004 23:41:34 GMT (envelope-from wsalamon@computer.org) Date: Thu, 29 Jul 2004 23:41:34 GMT Message-Id: <200407292341.i6TNfY2d060538@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to wsalamon@computer.org using -f From: Wayne Salamon To: Perforce Change Reviews Subject: PERFORCE change 58505 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2004 23:41:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=58505 Change 58505 by wsalamon@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 #include -#include +#include #include "auditreduce.h" ==== //depot/projects/trustedbsd/audit3/contrib/bsm/bin/praudit.c#2 (text+ko) ==== @@ -38,7 +38,7 @@ #include #include -#include +#include 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 #include -#include #include /* @@ -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 #endif +#ifdef AUDIT +#include +#endif #include #include @@ -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) {