Skip to content

Commit ba17059

Browse files
committed
ima_violations.sh: Fix log detection
Fix TBROK on systems which does not have /var/log/messages (any modern distro is using systemd) not auditd installed: ima_violations 1 TBROK: log /var/log/messages does not exist (bug in detection?) Instead TCONF with more meaningful message: ima_violations 1 TCONF: log file not found, install auditd Link: https://lore.kernel.org/ltp/[email protected]/ Fixes: #372 Reviewed-by: Mimi Zohar <[email protected]> Signed-off-by: Petr Vorel <[email protected]>
1 parent 9a88e8e commit ba17059

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

testcases/kernel/security/integrity/ima/tests/ima_violations.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ setup()
2323
PRINTK_RATE_LIMIT=`sysctl -n kernel.printk_ratelimit`
2424
sysctl -wq kernel.printk_ratelimit=0
2525
fi
26-
[ -f "$LOG" ] || \
27-
tst_brk TBROK "log $LOG does not exist (bug in detection?)"
26+
27+
if [ ! -e "$LOG" ]; then
28+
tst_brk TCONF "log file not found, install auditd"
29+
fi
2830
tst_res TINFO "using log $LOG"
2931
}
3032

0 commit comments

Comments
 (0)