Make 502.pfdenied find blacklistd/* filter names dynamically

This change is needed to make the 520.pfdenied script find the new
blacklistd/* anchor points for reporting blocked traffic.

Reviewed by:	kp
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Kurt Lidl 2016-10-04 23:12:35 +00:00
parent 30f7128157
commit d3de26c3d0

View file

@ -44,8 +44,7 @@ rc=0
if check_yesno_period security_status_pfdenied_enable
then
TMP=`mktemp -t security`
touch ${TMP}
for _a in "" blacklistd
for _a in "" $(pfctl -a "blacklistd" -sA 2>/dev/null)
do
pfctl -a ${_a} -sr -v -z 2>/dev/null | \
nawk '{if (/^block/) {buf=$0; getline; gsub(" +"," ",$0); if ($5 > 0) print buf$0;} }' >> ${TMP}