mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 17:59:20 -04:00
This is a workaround to the continuous taint mode incompatibilities with this code.
- This patch introduces a new rc variable called "mailscanner_user". If you changed the "Run As User" variable in MailScanner.conf (which triggers taint mode) you MUST now also set the same value in /etc/rc.conf. - Removed ulimit bump from startup script, since its now dynamically set at boot time based on system resources. - fixes permission problems with pid file. PR: ports/142382 Submitted by: Mike Jakubik <mike.jakubik@intertainservices.com>
This commit is contained in:
parent
9cebfcff86
commit
10b2562faa
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=247489
3 changed files with 27 additions and 9 deletions
|
@ -7,6 +7,7 @@
|
|||
|
||||
PORTNAME= MailScanner
|
||||
PORTVERSION= 4.79.4
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= mail
|
||||
MASTER_SITES= http://www.mailscanner.info/files/4/tar/
|
||||
DISTNAME= ${PORTNAME}-install-${PORTVERSION}-${PATCHLEVEL}
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
# Set it to "YES" to enable mailscanner
|
||||
# mailscanner_configfile (path): Set to "%%PREFIX%%/etc/MailScanner/MailScanner.conf" by default.
|
||||
# mailscanner_pidfile (path): Set to "/var/run/MailScanner.pid" by default.
|
||||
# mailscanner_user (str): Set to "root" by default. If you changed the "Run As User" variable in MailScanner.conf you MUST also set the same value here.
|
||||
#
|
||||
|
||||
. %%RC_SUBR%%
|
||||
|
@ -22,22 +23,27 @@ load_rc_config $name
|
|||
: ${mailscanner_enable="NO"}
|
||||
: ${mailscanner_configfile="%%PREFIX%%/etc/MailScanner/MailScanner.conf"}
|
||||
: ${mailscanner_pidfile="/var/run/MailScanner.pid"}
|
||||
: ${mailscanner_user="root"}
|
||||
|
||||
command="%%PREFIX%%/sbin/mailscanner"
|
||||
pidfile=${mailscanner_pidfile}
|
||||
command_args="${mailscanner_configfile}"
|
||||
procname="MailScanner"
|
||||
|
||||
required_files="${mailscanner_configfile}"
|
||||
|
||||
_ms_start_precmd() {
|
||||
# Quietly try to raise the open_files limit
|
||||
#
|
||||
ulimit -n 2000 >/dev/null 2>&1
|
||||
start_precmd=pid_touch
|
||||
start_cmd="mailscanner_start"
|
||||
|
||||
pid_touch ()
|
||||
{
|
||||
touch $mailscanner_pidfile
|
||||
chown $mailscanner_user $mailscanner_pidfile
|
||||
}
|
||||
|
||||
start_precmd=_ms_start_precmd
|
||||
|
||||
procname="MailScanner"
|
||||
mailscanner_start() {
|
||||
su -m ${mailscanner_user} -c "exec ${command} ${command_args}"
|
||||
}
|
||||
|
||||
run_rc_command "$1"
|
||||
|
||||
|
|
|
@ -38,7 +38,18 @@
|
|||
Sophos users: Please take a look at the Sophos install
|
||||
script %%PREFIX%%/share/doc/MailScanner/Sophos.install.freebsd
|
||||
|
||||
Please also always look at the port changelog at
|
||||
%%PREFIX%%/share/doc/MailScanner/CHANGES.port
|
||||
*****************************************************************
|
||||
A new rc variable called mailscanner_user has been added to the
|
||||
startup script. This is a temporary workaround to address the
|
||||
numerous taint mode problems that are still present in the code.
|
||||
|
||||
If you changed the "Run As User" variable in MailScanner.conf
|
||||
you MUST also set the same value in /etc/rc.conf.
|
||||
|
||||
i.e. mailscanner_user="postfix"
|
||||
|
||||
The new variable uses su to start the master perl script as the
|
||||
specified user, this effectively disables perl's taint mode.
|
||||
*****************************************************************
|
||||
|
||||
*************************************************************************
|
||||
|
|
Loading…
Add table
Reference in a new issue