Milter cleanups after problems reported in bz#579370.

Delete mirrors.dat in %post since I see no other way of getting
the permissions correct.
This commit is contained in:
Jan-Frode Myklebust 2011-03-18 09:05:10 +01:00
parent 86972941e6
commit 0de58a4451
2 changed files with 18 additions and 11 deletions

View File

@ -25,7 +25,7 @@ test -f /etc/sysconfig/clamav-milter && . /etc/sysconfig/clamav-milter
case "$1" in case "$1" in
start) start)
echo -n "Starting Clamav Milter Daemon: " echo -n "Starting Clamav Milter Daemon: "
daemon clamav-milter $CLAMAV_FLAGS $SOCKET_ADDRESS daemon clamav-milter $CLAMAV_FLAGS
RETVAL=$? RETVAL=$?
echo echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamav-milter [ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamav-milter

View File

@ -5,7 +5,7 @@
Summary: Anti-virus software Summary: Anti-virus software
Name: clamav Name: clamav
Version: 0.97 Version: 0.97
Release: 10%{?dist} Release: 11%{?dist}
License: GPLv2 License: GPLv2
Group: Applications/System Group: Applications/System
URL: http://www.clamav.net/ URL: http://www.clamav.net/
@ -160,6 +160,13 @@ you will need to install %{name}-devel.
s|^#(NotifyClamd) .+$|$1 %{_sysconfdir}/clamd.conf|; s|^#(NotifyClamd) .+$|$1 %{_sysconfdir}/clamd.conf|;
' etc/freshclam.conf ' etc/freshclam.conf
%{__perl} -pi.orig -e '
s|^(Example)|#$1|;
s|^#(User) .+$|$1 clam|;
s|^#(ClamdSocket) .+$|$1 %{_localstatedir}/run/clamav/clamd.sock|;
' etc/clamav-milter.conf
cat <<EOF >clamd.logrotate cat <<EOF >clamd.logrotate
%{_localstatedir}/log/clamav/clamd.log { %{_localstatedir}/log/clamav/clamd.log {
missingok missingok
@ -204,9 +211,7 @@ EOF
### Simple config file for clamav-milter, you should ### Simple config file for clamav-milter, you should
### read the documentation and tweak it as you wish. ### read the documentation and tweak it as you wish.
CLAMAV_FLAGS=" CLAMAV_FLAGS=""
--config-file=%{_sysconfdir}/clamd.conf
"
EOF EOF
%build %build
@ -252,12 +257,11 @@ touch %{buildroot}%{_localstatedir}/log/clamav/clamd.log
install -d -m0755 %{buildroot}%{_localstatedir}/run/clamav/ install -d -m0755 %{buildroot}%{_localstatedir}/run/clamav/
install -d -m0755 %{buildroot}%{_sysconfdir}/clamd.d/ install -d -m0755 %{buildroot}%{_sysconfdir}/clamd.d/
# mirrors.dat might exists with the wrong user on upgrades from pre v0.97,
# touch it here, and later %ghost it so that the permissions are fixed if needed.
touch %{buildroot}%{_localstatedir}/lib/clamav/mirrors.dat
%post %post
# Remove old mirrors.dat, mostly because it will have the wrong
# owner after upgrading from clamav < 0.97:
test -f /var/lib/clamav/mirrors.dat && rm -f /var/lib/clamav/mirrors.dat
/sbin/ldconfig /sbin/ldconfig
ZONES="/usr/share/zoneinfo/zone.tab" ZONES="/usr/share/zoneinfo/zone.tab"
@ -387,7 +391,6 @@ rm -rf %{buildroot}
%config(noreplace) %verify(user group mode) %{_localstatedir}/lib/clamav/ %config(noreplace) %verify(user group mode) %{_localstatedir}/lib/clamav/
%dir %{_localstatedir}/log/clamav/ %dir %{_localstatedir}/log/clamav/
%ghost %{_localstatedir}/log/clamav/freshclam.log %ghost %{_localstatedir}/log/clamav/freshclam.log
%ghost %{_localstatedir}/lib/clamav/mirrors.dat
%files devel %files devel
%defattr(-, root, root, 0755) %defattr(-, root, root, 0755)
@ -399,6 +402,10 @@ rm -rf %{buildroot}
%exclude %{_libdir}/libclamav.la %exclude %{_libdir}/libclamav.la
%changelog %changelog
* Fri Mar 18 2011 Jan-Frode Myklebust <janfrode@tanso.net> - 0.97-11
- Delete /var/lib/clamav/mirrors.dat, it will be recreated on first run.
- clamav-milter config cleanups.
* Wed Mar 16 2011 Jan-Frode Myklebust <janfrode@tanso.net> - 0.97-10 * Wed Mar 16 2011 Jan-Frode Myklebust <janfrode@tanso.net> - 0.97-10
- Make sure /var/lib/clamav/mirrors.dat has owner fixed on upgrade. - Make sure /var/lib/clamav/mirrors.dat has owner fixed on upgrade.
- Don't start clamd or milter service by default. - Don't start clamd or milter service by default.