chrony/test/system/099-scfilter
Miroslav Lichvar 97973b1833 sys_linux: add second scfilter level
Add level "2" to enable a filter which blocks only specific system calls
like fork and exec* instead of blocking everything unknown. It should
be reliable with respect to changes in libraries, but it provides only a
very limited protection.
2021-05-06 13:37:21 +02:00

24 lines
483 B
Bash
Executable file

#!/usr/bin/env bash
. ./test.common
check_chronyd_features SCFILTER || test_skip "SCFILTER support disabled"
test_start "system call filter in non-destructive tests"
for level in "-1" "1" "-2" "2"; do
test_message 1 1 "level $level:"
for test in 0[0-8][0-9]-*[^_]; do
test_message 2 0 "$test"
TEST_SCFILTER=$level "./$test" > /dev/null 2> /dev/null
result=$?
if [ $result != 0 ] && [ $result != 9 ] ; then
test_bad
test_fail
fi
test_ok
done
done
test_pass