diff --git a/scripts/ignored-calls.sh b/scripts/ignored-calls.sh index 9c4ae930..104db200 100755 --- a/scripts/ignored-calls.sh +++ b/scripts/ignored-calls.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright (C) 2019 The Falco Authors. +# Copyright (C) 2020 The Falco Authors. # # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,18 +15,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # +scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +parentdir="$(dirname "$scriptdir")" +sysdigdir="${parentdir}/build/sysdig-repo/sysdig-prefix/src/sysdig" +cat "${sysdigdir}/userspace/libscap/syscall_info_table.c" | grep EF_DROP_SIMPLE_CONS | sed -e 's/.*\"\(.*\)\".*/\1/' | sort > /tmp/ignored_syscall_info_table.txt +cat "${sysdigdir}/driver/event_table.c" | grep EF_DROP_SIMPLE_CONS | sed -e 's/[^\"]*\"\([^\"]*\)\".*/\1/' | sort | uniq > /tmp/ignored_driver_event_table.txt -cat ../sysdig/userspace/libscap/syscall_info_table.c | grep EF_DROP_SIMPLE_CONS | sed -e 's/.*\"\(.*\)\".*/\1/' | sort > ignored_syscall_info_table.txt -cat ../sysdig/driver/event_table.c | grep EF_DROP_SIMPLE_CONS | sed -e 's/[^\"]*\"\([^\"]*\)\".*/\1/' | sort | uniq > ignored_driver_event_table.txt -cat ../sysdig/userspace/libscap/event_table.c | grep EF_DROP_SIMPLE_CONS | sed -e 's/[^\"]*\"\([^\"]*\)\".*/\1/' | sort | uniq > ignored_userspace_event_table.txt - - -diff -up ignored_driver_event_table.txt ignored_userspace_event_table.txt - -if [ $? -ne 0 ]; then - echo "Expected ignored_driver_event_table.txt and ignored_userspace_event_table.txt to have same calls" -fi - - -cat ignored_userspace_event_table.txt ignored_syscall_info_table.txt | sort | uniq | tr '\n' ', ' +cat /tmp/ignored_driver_event_table.txt /tmp/ignored_syscall_info_table.txt | sort | uniq | tr '\n' ', '