summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrej Kacian <ticho@gentoo.org>2007-03-15 13:25:25 +0000
committerAndrej Kacian <ticho@gentoo.org>2007-03-15 13:25:25 +0000
commit974dbe060e678dc0cf9106ecfde835ed5070e86c (patch)
treeb219d9d249db9ad51ff1d7e53027dd950ad1232e /app-antivirus/clamav/files
parentAdded lirc device usb_uirt_raw, as requested by Robert Parenton <rparenton@la... (diff)
downloadhistorical-974dbe060e678dc0cf9106ecfde835ed5070e86c.tar.gz
historical-974dbe060e678dc0cf9106ecfde835ed5070e86c.tar.bz2
historical-974dbe060e678dc0cf9106ecfde835ed5070e86c.zip
Always fix permissions for clamd and freshclam logs. Bug #170739, by Sergey Borodich <bor at univ.kiev.ua>.
Package-Manager: portage-2.1.2.2
Diffstat (limited to 'app-antivirus/clamav/files')
-rw-r--r--app-antivirus/clamav/files/clamd.rc33
1 files changed, 23 insertions, 10 deletions
diff --git a/app-antivirus/clamav/files/clamd.rc b/app-antivirus/clamav/files/clamd.rc
index 493f3ea3cbb8..bed32bc0d49a 100644
--- a/app-antivirus/clamav/files/clamd.rc
+++ b/app-antivirus/clamav/files/clamd.rc
@@ -1,7 +1,7 @@
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/files/clamd.rc,v 1.10 2007/03/09 15:31:10 ticho Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/files/clamd.rc,v 1.11 2007/03/15 13:25:25 ticho Exp $
depend() {
use net
@@ -11,6 +11,17 @@ depend() {
start() {
local clamd_socket=`awk '$1 == "LocalSocket" { print $2 }' /etc/clamd.conf`
if [ "${START_CLAMD}" = "yes" ]; then
+ # fix clamd log permissions
+ # (might be clobbered by logrotate or something)
+ local logfile=`awk '$1 == "LogFile" { print $2 }' /etc/clamd.conf`
+ local clamav_user=`awk '$1 == "User" { print $2 }' /etc/clamd.conf`
+ if [[ -n "${logfile}" && -n "${clamav_user}" ]]; then
+ if [ ! -f "${logfile}" ]; then
+ touch ${logfile}
+ fi
+ chown ${clamav_user} ${logfile}
+ fi
+
if [ -S "${clamd_socket:-/tmp/clamd}" ]; then
rm -f ${clamd_socket:-/tmp/clamd}
fi
@@ -19,8 +30,19 @@ start() {
--exec /usr/sbin/clamd
eend $? "Failed to start clamd"
fi
+
if [ "${START_FRESHCLAM}" = "yes" ]; then
ebegin "Starting freshclam"
+
+ # fix freshclam log permissions
+ # (might be clobbered by logrotate or something)
+ logfile=`awk '$1 == "UpdateLogFile" { print $2 }' /etc/freshclam.conf`
+ if [[ -n "${logfile}" && -n "${clamav_user}" ]]; then
+ if [ ! -f "${logfile}" ]; then
+ touch ${logfile}
+ fi
+ chown ${clamav_user} ${logfile}
+ fi
start-stop-daemon --start --quiet \
--exec /usr/bin/freshclam -- -d
retcode=$?
@@ -36,15 +58,6 @@ start() {
rm -f ${MILTER_SOCKET}
fi
- local logfile=`awk '$1 == "LogFile" { print $2 }' /etc/clamd.conf`
- local clamav_user=`awk '$1 == "User" { print $2 }' /etc/clamd.conf`
- if [[ -n "${logfile}" && -n "${clamav_user}" ]]; then
- if [ ! -f "${logfile}" ]; then
- touch ${logfile}
- fi
- chown ${clamav_user} ${logfile}
- fi
-
ebegin "Starting clamav-milter"
start-stop-daemon --start --quiet \
--exec /usr/sbin/clamav-milter -- ${MILTER_OPTS} ${MILTER_SOCKET}