Skip to content

Commit b6f8c20

Browse files
LordGrimmauldstevegrubb
authored andcommitted
augenrules: use auditctl from sbindir
This allows running augenrules even if auditctl was not installed to `/sbin/auditctl` at system-wide fs root. This may be the case e.g. on non-FHS-compliant systems, as well as during testing when installing to a temporary prefix.
1 parent b80eaf4 commit b6f8c20

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

init.d/augenrules.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,21 @@ LoadRules=0
3434
RETVAL=0
3535
cmd="$0"
3636
usage="Usage: $cmd [--check|--load]"
37+
auditctl_bin=@sbindir@/auditctl
3738

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

4142
try_load() {
4243
if [ $LoadRules -eq 1 ] ; then
43-
/sbin/auditctl -R ${DestinationFile}
44+
$auditctl_bin -R ${DestinationFile}
4445
RETVAL=$?
4546
fi
4647
}
4748

4849
# Check if audit is in immutable mode - exit if so
4950
check_immutable () {
50-
if [ "$(auditctl -s | awk '$1 == "enabled" { print $2 }')" = "2" ] ; then
51+
if [ "$($auditctl_bin -s | awk '$1 == "enabled" { print $2 }')" = "2" ] ; then
5152
echo "$cmd: Audit system is in immutable mode - exiting with no changes"
5253
exit 0
5354
fi

0 commit comments

Comments
 (0)