On 2022/04/03 01:50, Clint Pachl wrote:
> Setting aside pflog, I still think there may have been an error
> introduced in revision 1.2, as I stated in my bug description below.
> 
> Unless "rc_pre" works in a way that I don't understand, the first line
> of the rc_pre function in rc.d/spamlogd is an error; it's an unchecked
> condition.

Hmm, I wonder if this code used to run with "set -e" (which does work
as expected with the unchecked condition).

> Here's a patch to explain:

alternatively, avoiding extending the laddered if:

Index: spamlogd
===================================================================
RCS file: /cvs/src/etc/rc.d/spamlogd,v
retrieving revision 1.4
diff -u -p -r1.4 spamlogd
--- spamlogd    11 Jan 2018 21:09:26 -0000      1.4
+++ spamlogd    3 Apr 2022 11:05:21 -0000
@@ -9,7 +9,7 @@ daemon="/usr/libexec/spamlogd"
 rc_reload=NO
 
 rc_pre() {
-       [[ ${spamd_flags} != NO && ${spamd_black} == NO ]]
+       [[ ${spamd_flags} != NO && ${spamd_black} == NO ]] && return 1
        if pfctl -si | grep -q Enabled; then
                ifconfig pflog0 create
                if ifconfig pflog0; then

Reply via email to