From d8ffc21c5ca6f7d4f2d9a65dc6308699af0b6a01 Mon Sep 17 00:00:00 2001 From: Kristof Provost Date: Thu, 16 Jan 2020 22:08:05 +0000 Subject: [PATCH] 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 --- usr.sbin/periodic/etc/security/520.pfdenied | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/periodic/etc/security/520.pfdenied b/usr.sbin/periodic/etc/security/520.pfdenied index e3021ce857c9..69d9df78436b 100755 --- a/usr.sbin/periodic/etc/security/520.pfdenied +++ b/usr.sbin/periodic/etc/security/520.pfdenied @@ -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