summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-08-15 17:09:32 +0000
committerjhb <jhb@FreeBSD.org>2006-08-15 17:09:32 +0000
commit3cbb1cf2564c4574c6cd5eb7f6358e8484212eb3 (patch)
tree26f6164cf1defab09c183fd43c35b98dfcda95b4 /sys
parenta620e8e32b4fc6903ee03784c0c3613aefffd258 (diff)
downloadFreeBSD-src-3cbb1cf2564c4574c6cd5eb7f6358e8484212eb3.zip
FreeBSD-src-3cbb1cf2564c4574c6cd5eb7f6358e8484212eb3.tar.gz
Add a new set of macros <prefix>_AUE_<syscallname> to sysproto.h that
map to the audit event associated with a specific system call. For example, SYS_AUE___semctl would be set to AUE_SEMCTL in sys/sysproto.h.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/makesyscalls.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/kern/makesyscalls.sh b/sys/kern/makesyscalls.sh
index 709dde0..70cccb1 100644
--- a/sys/kern/makesyscalls.sh
+++ b/sys/kern/makesyscalls.sh
@@ -21,6 +21,7 @@ namesname="syscallnames"
systrace="systrace_args.c"
# tmp files:
+sysaue="sysent.aue.$$"
sysdcl="sysent.dcl.$$"
syscompat="sysent.compat.$$"
syscompatdcl="sysent.compatdcl.$$"
@@ -31,9 +32,9 @@ sysinc="sysinc.switch.$$"
sysarg="sysarg.switch.$$"
sysprotoend="sysprotoend.$$"
-trap "rm $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $sysent $sysinc $sysarg $sysprotoend" 0
+trap "rm $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $sysent $sysinc $sysarg $sysprotoend" 0
-touch $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $sysent $sysinc $sysarg $sysprotoend
+touch $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $sysent $sysinc $sysarg $sysprotoend
case $# in
0) echo "usage: $0 input-file <config-file>" 1>&2
@@ -59,6 +60,7 @@ s/\$//g
}
' < $1 | awk "
BEGIN {
+ sysaue = \"$sysaue\"
sysdcl = \"$sysdcl\"
sysproto = \"$sysproto\"
sysprotoend = \"$sysprotoend\"
@@ -125,6 +127,7 @@ s/\$//g
printf "#include <sys/acl.h>\n" > sysarg
printf "#include <posix4/_semaphore.h>\n" > sysarg
printf "#include <sys/ucontext.h>\n\n" > sysarg
+ printf "#include <bsm/audit_kevents.h>\n\n" > sysarg
printf "struct proc;\n\n" > sysarg
printf "struct thread;\n\n" > sysarg
printf "#define\tPAD_(t)\t(sizeof(register_t) <= sizeof(t) ? \\\n" > sysarg
@@ -343,6 +346,8 @@ s/\$//g
printf("%s\t%s(struct thread *, struct %s *)",
rettype, funcname, argalias) > sysdcl
printf(";\n") > sysdcl
+ printf("#define\t%sAUE_%s\t%s\n", syscallprefix,
+ funcalias, auditev) > sysaue
}
if (funcname == "nosys")
nosys = 1
@@ -481,7 +486,7 @@ s/\$//g
printf("\n#endif /* %s */\n\n", compat4) > syscompat4dcl
- printf("#undef PAD_\n") > sysprotoend
+ printf("\n#undef PAD_\n") > sysprotoend
printf("#undef PADL_\n") > sysprotoend
printf("#undef PADR_\n") > sysprotoend
printf("\n#endif /* !%s */\n", sysproto_h) > sysprotoend
@@ -498,5 +503,5 @@ cat $sysinc $sysent >> $syssw
cat $sysarg $sysdcl \
$syscompat $syscompatdcl \
$syscompat4 $syscompat4dcl \
- $sysprotoend > $sysproto
+ $sysaue $sysprotoend > $sysproto
OpenPOWER on IntegriCloud