diff options
author | Andrej Kacian <ticho@gentoo.org> | 2007-03-15 13:25:25 +0000 |
---|---|---|
committer | Andrej Kacian <ticho@gentoo.org> | 2007-03-15 13:25:25 +0000 |
commit | acdedebae01d72e8cace57784cbdb49ad5076615 (patch) | |
tree | 435854051cc8b2030b1784b7af57484829a2d3d3 /app-antivirus/clamav/files | |
parent | Stable on ppc64; bug #169987 (diff) | |
download | gentoo-2-acdedebae01d72e8cace57784cbdb49ad5076615.tar.gz gentoo-2-acdedebae01d72e8cace57784cbdb49ad5076615.tar.bz2 gentoo-2-acdedebae01d72e8cace57784cbdb49ad5076615.zip |
Always fix permissions for clamd and freshclam logs. Bug #170739, by Sergey Borodich <bor at univ.kiev.ua>.
(Portage version: 2.1.2.2)
Diffstat (limited to 'app-antivirus/clamav/files')
-rw-r--r-- | app-antivirus/clamav/files/clamd.rc | 33 |
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} |