From ac48c079b01c85a115bd660da260a04ba94e025a Mon Sep 17 00:00:00 2001 From: qua3k Date: Fri, 17 Jun 2022 13:18:02 -0400 Subject: [PATCH] Print error message on empty BPF This is useful when we're not sure if a filter is installed or not --- lib/seccomp-tools/dumper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/seccomp-tools/dumper.rb b/lib/seccomp-tools/dumper.rb index 821bf79..47dbed6 100644 --- a/lib/seccomp-tools/dumper.rb +++ b/lib/seccomp-tools/dumper.rb @@ -182,6 +182,7 @@ def dump_by_pid(pid, limit, &block) begin bpf = Ptrace.seccomp_get_filter(pid, i) rescue Errno::ENOENT, Errno::EINVAL + Logger.error('No seccomp filters installed') break end collect << (block.nil? ? bpf : yield(bpf, nil))