On Sat, Aug 6, 2011 at 7:11 AM, Stuart Henderson <s...@spacehopper.org> wrote:
> Since pflog interface creation was moved to rc.d/pflogd, you can
> no longer run spamlogd without also running pflogd. This diff copies
> the interface creation code from pflogd (it doesn't hurt to create
> pflog0 twice).
>
> This doesn't handle the case with spamlogd -l where a non-default
> interface is used (but neither does pflogd handle the case with -i),
> but I think for non-default options it's reasonable to expect the
> user to do a little more work (e.g. 'echo up > /etc/hostname.pflog1').
>
> Index: spamlogd
> ===================================================================
> RCS file: /cvs/src/etc/rc.d/spamlogd,v
> retrieving revision 1.1
> diff -u -p -r1.1 spamlogd
> --- spamlogd B  B 8 Jul 2011 02:15:34 -0000 B  B  B  1.1
> +++ spamlogd B  B 6 Aug 2011 11:32:39 -0000
> @@ -10,6 +10,17 @@ rc_reload=NO
>
> B rc_pre() {
> B  B  B  B [ B X"${spamd_flags}" != X"NO" -a X"${spamd_black}" = X"NO" ]

this check needs to return 1 if it fails

or you're assuming it's a set -e shell?

> +
> + B  B  B  if pfctl -si | grep -q Enabled; then
> + B  B  B  B  B  B  B  ifconfig pflog0 create
> + B  B  B  B  B  B  B  if ifconfig pflog0; then
> + B  B  B  B  B  B  B  B  B  B  B  ifconfig pflog0 up
> + B  B  B  B  B  B  B  else
> + B  B  B  B  B  B  B  B  B  B  B  return 1
> + B  B  B  B  B  B  B  fi
> + B  B  B  else
> + B  B  B  B  B  B  B  return 1
> + B  B  B  fi
> B }
>
> B rc_cmd $1

Reply via email to