Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ bindings/swig/python3/audit_wrap.c
bindings/swig/python3/_audit.so
init.d/auditd.service
init.d/audit-rules.service
init.d/augenrules
lib/*tabs.h
lib/*tables.h
ltmain.sh
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ AC_CONFIG_FILES([Makefile common/Makefile lib/Makefile lib/audit.pc
bindings/python/python3/Makefile bindings/golang/Makefile
bindings/swig/Makefile bindings/swig/src/Makefile
bindings/swig/python3/Makefile tools/Makefile tools/aulast/Makefile
tools/aulast/test/Makefile
tools/aulast/test/Makefile init.d/augenrules
tools/aulastlog/Makefile tools/ausyscall/Makefile m4/Makefile],
[chmod +x auparse/test/run_auparse_tests.sh auparse/test/run_auparselol_test.sh])
AC_OUTPUT
Expand Down
9 changes: 5 additions & 4 deletions init.d/augenrules → init.d/augenrules.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env sh

# Script to concatenate rules files found in a base audit rules directory
# to form a single /etc/audit/audit.rules file suitable for loading into
Expand Down Expand Up @@ -34,20 +34,21 @@ LoadRules=0
RETVAL=0
cmd="$0"
usage="Usage: $cmd [--check|--load]"
auditctl_bin=@sbindir@/auditctl

# Delete the interim file on faults
trap 'rm -f ${TmpRules}; exit 1' HUP INT QUIT PIPE TERM

try_load() {
if [ $LoadRules -eq 1 ] ; then
/sbin/auditctl -R ${DestinationFile}
$auditctl_bin -R ${DestinationFile}
RETVAL=$?
fi
}

# Check if audit is in immutable mode - exit if so
check_immutable () {
if [ "$(auditctl -s | awk '$1 == "enabled" { print $2 }')" = "2" ] ; then
if [ "$($auditctl_bin -s | awk '$1 == "enabled" { print $2 }')" = "2" ] ; then
echo "$cmd: Audit system is in immutable mode - exiting with no changes"
exit 0
fi
Expand Down Expand Up @@ -83,7 +84,7 @@ fi
# - the last processed -e directive is emitted as the last line
umask 0137
echo "## This file is automatically generated from $SourceRulesDir" >> "${TmpRules}"
for rules in $(/bin/ls -1v ${SourceRulesDir} | grep "\.rules$") ; do
for rules in $(ls -1v ${SourceRulesDir} | grep "\.rules$") ; do
cat ${SourceRulesDir}/"${rules}"
done | awk '
BEGIN {
Expand Down