1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-29 05:38:00 +00:00

security/clamav: handle memfs/tmpfs /var/run.

PR:		224728
Submitted by:	O. Harmann <ohartmann@walstatt.org>
This commit is contained in:
Larry Rosenman 2017-12-30 22:25:18 +00:00
parent d7b612b753
commit 181b7c02ee
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=457649
3 changed files with 23 additions and 2 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= clamav
PORTVERSION= 0.99.2
PORTREVISION= 6
PORTREVISION= 7
CATEGORIES= security
MASTER_SITES= http://www.clamav.net/downloads/production/
@ -94,6 +94,7 @@ CLAMAVUSER?= clamav
CLAMAVGROUP?= clamav
CLAMAV_CLAMD_SOCKET?= ${RUNDIR}/clamd.sock
CLAMAV_CLAMD_PIDFILE?= ${RUNDIR}/clamd.pid
CLAMAV_MILTER_SOCKET?= ${RUNDIR}/clmilter.sock
SUB_FILES= pkg-deinstall
@ -105,6 +106,7 @@ SUB_LIST+= DBDIR=${DBDIR} \
CLAMAVUSER=${CLAMAVUSER} \
CLAMAVGROUP=${CLAMAVGROUP} \
CLAMAV_CLAMD_SOCKET=${CLAMAV_CLAMD_SOCKET} \
CLAMAV_CLAMD_PIDFILE=${CLAMAV_CLAMD_PIDFILE} \
CLAMAV_MILTER_SOCKET=${CLAMAV_MILTER_SOCKET}
SED_CONF= -E -e 's|^\#?(Example)$$|\#\1|' \

View File

@ -27,6 +27,8 @@ load_rc_config "$name"
: ${clamav_clamd_enable:=NO}
: ${clamav_clamd_socket="%%CLAMAV_CLAMD_SOCKET%%"}
: ${clamav_clamd_pidfile="%%CLAMAV_CLAMD_PIDFILE%%"}
: ${clamav_clamd_user="%%CLAMAVUSER%%"}
command=%%PREFIX%%/sbin/clamd
required_dirs=%%DBDIR%%
@ -39,6 +41,10 @@ reload_cmd="%%PREFIX%%/bin/clamdscan --reload"
#clamav .93 won't start without a valid main.c[vl]d file
clamav_clamd_precmd()
{
local rundir=${clamav_clamd_pidfile%/*}
if [ ! -d $rundir ] ; then
install -d -m 0755 -o ${clamav_clamd_user} -g ${clamav_clamd_user} $rundir
fi
if [ ! -f %%DBDIR%%/main.cvd -a ! -f %%DBDIR%%/main.cld ];then
echo "Missing %%DBDIR%%/*.cvd or *.cld files. You must run freshclam first"
exit 1

View File

@ -22,14 +22,27 @@
name=clamav_freshclam
rcvar=clamav_freshclam_enable
# read settings, set default values
load_rc_config ${name}
: ${clamav_freshclam_enable:=NO}
: ${clamav_freshclam_pidfile=%%RUNDIR%%/freshclam.pid}
: ${clamav_freshclam_user=%%CLAMAVUSER%%}
command=%%PREFIX%%/bin/freshclam
pidfile=%%RUNDIR%%/freshclam.pid
pidfile=${clamav_freshclam_pidfile}
command_args="--daemon -p ${pidfile}"
required_dirs=%%DBDIR%%
required_files=%%PREFIX%%/etc/freshclam.conf
start_precmd=clamav_freshclam_precmd
clamav_freshclam_precmd()
{
local rundir=${clamav_freshclam_pidfile%/*}
if [ ! -d $rundir ] ; then
install -d -m 0755 -o ${clamav_freshclam_user} -g ${clamav_freshclam_user} $rundir
fi
}
run_rc_command "$1"