hasufell 14/08/13 14:10:07
Added: postgrey-1.34-r3.rc.new
postgrey-1.34-perl-5.18.patch
Log:
bump 1.34 to eapi=5, fix init script wrt #500174, backport upstream patch for
1.34 to work with perl-5.18, fix broken style
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key
BDEED020)
Revision Changes Path
1.1 mail-filter/postgrey/files/postgrey-1.34-r3.rc.new
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-filter/postgrey/files/postgrey-1.34-r3.rc.new?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-filter/postgrey/files/postgrey-1.34-r3.rc.new?rev=1.1&content-type=text/plain
Index: postgrey-1.34-r3.rc.new
===================================================================
#!/sbin/runscript
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header:
/var/cvsroot/gentoo-x86/mail-filter/postgrey/files/postgrey-1.34-r3.rc.new,v
1.1 2014/08/13 14:10:06 hasufell Exp $
conf="/etc/conf.d/postgrey"
extra_started_commands="reload"
depend() {
need net
before postfix
provide postfix_greylist
}
conf_error() {
eerror "You need to setup ${conf} first"
return 1
}
checkconfig() {
if [ -z "${POSTGREY_TYPE}" ]
then
einfo "You need to choose the server type you want"
einfo "by setting the POSTGREY_TYPE variable in ${conf}."
else
if [ "x${POSTGREY_TYPE}" = "xinet" ]
then
if [ -z "${POSTGREY_PORT}" ] || [ -z "${POSTGREY_HOST}"
]
then
einfo "The following entries are
missing in ${conf}:"
[ -z "${POSTGREY_HOST}" ] && einfo " -
POSTGREY_HOST"
[ -z "${POSTGREY_PORT}" ] && einfo " -
POSTGREY_PORT"
conf_error
fi
POSTGREY_ADDR="${POSTGREY_TYPE}=${POSTGREY_HOST}:${POSTGREY_PORT}"
else
if [ -z "${POSTGREY_SOCKET}" ]
then
einfo "The following entries are missing in
${conf}:"
[ -z "${POSTGREY_SOCKET}" ] && einfo " -
POSTGREY_SOCKET"
conf_error
fi
POSTGREY_ADDR="${POSTGREY_TYPE}=${POSTGREY_SOCKET}"
fi
fi
if [ -z "${POSTGREY_PID}" ]
then
einfo "The following entries are missing in ${conf}:"
[ -z "${POSTGREY_PID}" ] && einfo " - POSTGREY_PID"
conf_error
fi
}
start() {
checkconfig || return 1
ebegin "Starting Postgrey"
# HACK -- start a subshell and corrects perms on the socket...
if [ "x${POSTGREY_TYPE}" = "xunix" ]; then
rm -f ${POSTGREY_SOCKET}
( while ! test -S ${POSTGREY_SOCKET}; do sleep 1; done; chmod
a+rw,a-x ${POSTGREY_SOCKET} ) &
fi
if [ -z ${POSTGREY_DELAY} ] ; then
POSTGREY_DELAY_ARG=""
else
POSTGREY_DELAY_ARG="--delay=${POSTGREY_DELAY}"
fi
if [ -z "${POSTGREY_TEXT}" ] ; then
POSTGREY_TEXT_ARG=""
else
POSTGREY_TEXT_ARG="--greylist-text=${POSTGREY_TEXT}"
fi
start-stop-daemon --start --quiet --background \
--pidfile=${POSTGREY_PID} \
--name postgrey \
--exec /usr/sbin/postgrey -- \
--${POSTGREY_ADDR} \
--daemonize \
--pidfile=${POSTGREY_PID} \
${POSTGREY_DELAY_ARG} \
${POSTGREY_OPTS} \
"${POSTGREY_TEXT_ARG}"
eend ${?}
}
stop() {
ebegin "Stopping Postgrey"
start-stop-daemon --stop --quiet --pidfile ${POSTGREY_PID}
eend ${?}
}
reload() {
ebegin "Reloading Postgrey"
start-stop-daemon --stop --signal HUP --oknodo --pidfile ${POSTGREY_PID}
eend $?
}
1.1 mail-filter/postgrey/files/postgrey-1.34-perl-5.18.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-filter/postgrey/files/postgrey-1.34-perl-5.18.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-filter/postgrey/files/postgrey-1.34-perl-5.18.patch?rev=1.1&content-type=text/plain
Index: postgrey-1.34-perl-5.18.patch
===================================================================
>From 9673b54064691a5b9c295ffea340d8a1f9ee1cb8 Mon Sep 17 00:00:00 2001
From: Yasuhiro KIMURA <[email protected]>
Date: Sat, 17 Aug 2013 22:05:27 +0900
Subject: [PATCH] Make postgrey work with Perl 5.18
---
postgrey | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/postgrey b/postgrey
index 7cb0352..37f69bd 100755
--- a/postgrey
+++ b/postgrey
@@ -557,6 +557,16 @@ sub main()
if($opt{dbdir}) {
$opt{dbdir} =~ /^(.*)$/; $opt{dbdir} = $1;
}
+ # untaint what is given on --pidfile. It is not security sensitive since
+ # it is provided by the admin
+ if($opt{pidfile}) {
+ $opt{pidfile} =~ /^(.*)$/; $opt{pidfile} = $1;
+ }
+ # untaint what is given on --inet. It is not security sensitive since
+ # it is provided by the admin
+ if($opt{inet}) {
+ $opt{inet} =~ /^(.*)$/; $opt{inet} = $1;
+ }
# determine proper "logsock" for Sys::Syslog
my $syslog_logsock;
--
2.0.3