ports/137992: [PATCH] The startup script of mail/spamd has several bugs
Denny Lin
dennylin93 at cnmc32.hs.ntnu.edu.tw
Thu Aug 20 13:00:09 UTC 2009
>Number: 137992
>Category: ports
>Synopsis: [PATCH] The startup script of mail/spamd has several bugs
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Aug 20 13:00:09 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: Denny Lin
>Release: FreeBSD 7.2-RELEASE-p3
>Organization:
>Environment:
FreeBSD cnmc32.hs.ntnu.edu.tw 7.2-RELEASE-p3 FreeBSD 7.2-RELEASE-p3 #0: Mon Aug 10 17:02:08 CST 2009 root at cnmc32.hs.ntnu.edu.tw:/usr/obj/usr/src/sys/CNMC32 amd64
>Description:
1. Originally, the -b flag required a space before it in case of a misread such as 'IP-based'. This can be worked around by using "(^\-b| \-b)", so now the script functions normally even when no space it added.
2. When spamd is started in blacklist mode, the -b flag for is appended by obspamd_flags. However, spamd-setup in the startup script doesn't use this setting. As a result, the blacklists fail to load in blacklist mode. By adding if and else conditions, this can be fixed as well.
>How-To-Repeat:
Simply use blacklist mode with a normal installation of mail/spamd.
>Fix:
See patch.
Patch attached with submission follows:
--- ports/mail/spamd/files/obspamd.in.orig 2009-08-20 20:44:15.000000000 +0800
+++ ports/mail/spamd/files/obspamd.in 2009-08-20 20:52:18.000000000 +0800
@@ -35,10 +35,7 @@
obspamd_precmd()
{
_rc=0
- # we need the white-space in the grep expr. to limit a failure
- # in parsing the flags, for example if someone
- # defined the word 'IP-based' in the banner.
- echo "${obspamd_flags}" | grep " \-b" 2>&1 > /dev/null
+ echo "${obspamd_flags}" | egrep "(^\-b| \-b)" 2>&1 > /dev/null
if [ $? -eq 1 ]; then
/sbin/mount -p | grep 'fdescfs.*/dev/fd.*fdescfs.*rw' 2>&1 > /dev/null
_rc=${?}
@@ -58,7 +55,12 @@
{
if [ -x %%PREFIX%%/sbin/spamd-setup ]; then
if [ -r %%PREFIX%%/etc/spamd/spamd.conf ]; then
- %%PREFIX%%/sbin/spamd-setup -D
+ echo "${obspamd_flags}" | egrep "(^\-b| \-b)" 2>&1 > /dev/null
+ if [ $? ]; then
+ %%PREFIX%%/sbin/spamd-setup -bD
+ else
+ %%PREFIX%%/sbin/spamd-setup -D
+ fi
fi
fi
}
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list