Fix pfdenied not returning any results

When _a is empty we end up with an invalid invocation of pfctl, and no output.
We must add quotes to make it clear to pfctl that we're passing an empty anchor
name.

PR:		224415
Submitted by:	sigsys AT gmail.com
MFC after:	2 weeks
This commit is contained in:
Kristof Provost 2020-01-16 22:08:05 +00:00
parent e82ba2c544
commit d8ffc21c5c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=356816

View File

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