mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-27 05:10:36 +00:00
- Update to 3.0.3 (1)
- Don't run spamd from root anymore. Use spamd user instead. Put PID file in /var/run/spamd/ as result. - A patch for fixing spamd that did not drop privileges for children (2) - Rename SQL variable to more clean SQL_FLAG. PR: ports/80556 (1) Submitted by: Linh Pham <question+fbsdports@closedsrc.org> (1) Brandon Kuczenski <brandon@301south.net> (perl@) (2) Obtained from: http://bugzilla.spamassassin.org/show_bug.cgi?id=3897 (2)
This commit is contained in:
parent
7a4bbb1462
commit
dc2973ac8a
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=134729
@ -6,8 +6,7 @@
|
||||
#
|
||||
|
||||
PORTNAME= Mail-SpamAssassin
|
||||
PORTVERSION= 3.0.2
|
||||
PORTREVISION= 1
|
||||
PORTVERSION= 3.0.3
|
||||
CATEGORIES= mail perl5
|
||||
MASTER_SITES= ${MASTER_SITE_APACHE:S/$/:apache/} ${MASTER_SITE_PERL_CPAN:S/$/:cpan/}
|
||||
MASTER_SITE_SUBDIR= spamassassin/:apache Mail/:cpan
|
||||
@ -89,9 +88,9 @@ USE_RC_SUBR= yes
|
||||
SED_SCRIPT= -e 's|%%PREFIX%%|${PREFIX}|g' \
|
||||
-e 's|%%RC_SUBR%%|${RC_SUBR}|g'
|
||||
.if defined(USE_SQLDB)
|
||||
SED_SCRIPT+= -e 's|%%SQL%%|-Q|g'
|
||||
SED_SCRIPT+= -e 's|%%SQL_FLAG%%|-Q|g'
|
||||
.else
|
||||
SED_SCRIPT+= -e 's|%%SQL%%||g'
|
||||
SED_SCRIPT+= -e 's|%%SQL_FLAG%%||g'
|
||||
.endif
|
||||
|
||||
pre-patch:
|
||||
@ -118,6 +117,9 @@ post-patch:
|
||||
post-build:
|
||||
@${SED} ${SED_SCRIPT} ${FILESDIR}/spamd.sh > ${WRKDIR}/sa-spamd.sh
|
||||
|
||||
pre-install:
|
||||
@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
|
||||
|
||||
post-install:
|
||||
@${STRIP_CMD} ${PREFIX}/bin/spamc
|
||||
@${INSTALL_SCRIPT} ${WRKDIR}/sa-spamd.sh ${PREFIX}/etc/rc.d/sa-spamd.sh
|
||||
|
@ -1,2 +1,2 @@
|
||||
MD5 (Mail-SpamAssassin-3.0.2.tar.gz) = 2a654d0819a730aab3fbbba83da62bc0
|
||||
SIZE (Mail-SpamAssassin-3.0.2.tar.gz) = 996164
|
||||
MD5 (Mail-SpamAssassin-3.0.3.tar.gz) = ca96f23cd1eb7d663ab55db98ef8090c
|
||||
SIZE (Mail-SpamAssassin-3.0.3.tar.gz) = 999558
|
||||
|
22
mail/p5-Mail-SpamAssassin/files/patch-spamd_spamd.raw
Normal file
22
mail/p5-Mail-SpamAssassin/files/patch-spamd_spamd.raw
Normal file
@ -0,0 +1,22 @@
|
||||
--- spamd/spamd.raw.orig Fri May 6 20:16:50 2005
|
||||
+++ spamd/spamd.raw Fri May 6 20:17:30 2005
|
||||
@@ -881,12 +881,14 @@
|
||||
}
|
||||
|
||||
# if we changed UID during processing, change back!
|
||||
- if ( $> != $< and $> != ( $< - 2**32 ) ) {
|
||||
- $) = "$( $("; # change eGID
|
||||
- $> = $<; # change eUID
|
||||
+ if($setuid_to_user) {
|
||||
if ( $> != $< and $> != ( $< - 2**32 ) ) {
|
||||
- logmsg("fatal: return setuid failed");
|
||||
- die; # make it fatal to avoid security breaches
|
||||
+ $) = "$( $("; # change eGID
|
||||
+ $> = $<; # change eUID
|
||||
+ if ( $> != $< and $> != ( $< - 2**32 ) ) {
|
||||
+ logmsg("fatal: return setuid failed");
|
||||
+ die; # make it fatal to avoid security breaches
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
@ -34,8 +34,8 @@ stop_postcmd()
|
||||
# set defaults
|
||||
|
||||
spamd_enable=${spamd_enable:-"NO"}
|
||||
spamd_pidfile=${spamd_pidfile:-"/var/run/spamd.pid"}
|
||||
spamd_flags=${spamd_flags:-"-c -d %%SQL%% -r ${spamd_pidfile}"}
|
||||
spamd_pidfile=${spamd_pidfile:-"/var/run/spamd/spamd.pid"}
|
||||
spamd_flags=${spamd_flags:-"-c -d %%SQL_FLAG%% -r ${spamd_pidfile} -u spamd -H /var/spool/spamd"}
|
||||
|
||||
load_rc_config $name
|
||||
run_rc_command "$1"
|
||||
|
13
mail/p5-Mail-SpamAssassin/pkg-deinstall
Normal file
13
mail/p5-Mail-SpamAssassin/pkg-deinstall
Normal file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$2" != "POST-DEINSTALL" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
USER=spamd
|
||||
|
||||
if pw usershow "${USER}" 2>/dev/null 1>&2; then
|
||||
echo "To delete ${USER} user permanently, use 'rmuser ${USER}'"
|
||||
fi
|
||||
|
||||
exit 0
|
38
mail/p5-Mail-SpamAssassin/pkg-install
Normal file
38
mail/p5-Mail-SpamAssassin/pkg-install
Normal file
@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$2" != "PRE-INSTALL" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
USER=spamd
|
||||
GROUP=${USER}
|
||||
UID=58
|
||||
GID=${UID}
|
||||
HOME=/var/spool/${USER}
|
||||
|
||||
if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
|
||||
if pw groupadd ${GROUP} -g ${GID}; then
|
||||
echo "Added group \"${GROUP}\"."
|
||||
else
|
||||
echo "Adding group \"${GROUP}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! pw usershow "${USER}" 2>/dev/null 1>&2; then
|
||||
if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
|
||||
-s "/sbin/nologin" -d "${HOME}" \
|
||||
-c "SpamAssassin user"; \
|
||||
then
|
||||
echo "Added user \"${USER}\"."
|
||||
mkdir ${HOME} && chown ${USER}:${GROUP} ${HOME}
|
||||
else
|
||||
echo "Adding user \"${USER}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Create pid directory
|
||||
mkdir /var/run/spamd && chown ${USER}:${GROUP} /var/run/spamd
|
||||
|
||||
exit 0
|
@ -1,3 +1,4 @@
|
||||
@unexec %D/etc/rc.d/sa-spamd.sh stop > /dev/null 2>&1 || true
|
||||
bin/sa-learn
|
||||
bin/spamassassin
|
||||
bin/spamc
|
||||
@ -92,3 +93,4 @@ etc/rc.d/sa-spamd.sh
|
||||
@unexec rmdir %D/%%SITE_PERL%%/Mail 2>/dev/null || true
|
||||
@unexec rmdir %D/etc/mail/spamassassin 2>/dev/null || true
|
||||
@unexec rmdir %D/etc/mail 2>/dev/null || true
|
||||
@unexec rmdir /var/run/spamd 2>/dev/null || true
|
||||
|
Loading…
Reference in New Issue
Block a user