Skip to content

Commit

Permalink
Print error message on empty BPF
Browse files Browse the repository at this point in the history
This is useful when we're not sure if a filter is installed or not
  • Loading branch information
qua3k committed Jun 17, 2022
1 parent 808358b commit ac48c07
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/seccomp-tools/dumper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit ac48c07

Please sign in to comment.