diff -u clamav-0.95.1+dfsg/debian/clamav-milter.postinst.in clamav-0.95.1+dfsg/debian/clamav-milter.postinst.in --- clamav-0.95.1+dfsg/debian/clamav-milter.postinst.in +++ clamav-0.95.1+dfsg/debian/clamav-milter.postinst.in @@ -224,9 +224,11 @@ echo " /etc/init.d/clamav-milter restart > /dev/null" >> $DEBROTATEFILE echo " endscript" >> $DEBROTATEFILE echo " }" >> $DEBROTATEFILE - touch "$LogFile" - chown "$User":adm "$LogFile" - chmod 0640 "$LogFile" + if [ -n "$LogFile" ] && [ "$LogFile" != 'none' ]; then + touch "$LogFile" + chown "$User":adm "$LogFile" + chmod 0640 "$LogFile" + fi ucf_cleanup "$CLAMAVROTATEFILE" ucf_upgrade_check "$CLAMAVROTATEFILE" "$DEBROTATEFILE" /var/lib/ucf/cache/:etc:logrotate.d:clamav-milter rm -f $DEBROTATEFILE @@ -254,6 +256,36 @@ ;; esac +# clamav-milter between 0.95+dfsg-2ubuntu1 and 0.95.1+dfsg-1ubuntu1.1 had +# broken init and postinst scripts, which did some bad things +# this should clean it up (LP: #365823, #363796, #363804) +if dpkg --compare-versions "$2" le-nl "0.95.1+dfsg-1ubuntu1.1" && + dpkg --compare-versions "$2" ge "0.95+dfsg-2ubuntu1" +then + # fix '/' owner + chown root / + + # remove rogue /none file created by postinst + find /none -type f -size 0 -user clamav -exec rm -f {} \; 2>/dev/null || true + + # search for and fix other directories' owner + DIR_LIST=" \ + /bin /boot /dev /etc /lib /lib32 /lib64 /root /sbin /usr \ + /var/backups /var/cache /var/games /var/lib /var/local \ + /var/log /var/mail /var/spool" + find -H $DIR_LIST -type d -user clamav -gid 0 -print0 2>/dev/null | xargs -r -0 chown root -- 2>/dev/null || true + + STICKY_DIR_LIST="/tmp /var/crash /var/lock /var/tmp" + find $STICKY_DIR_LIST -maxdepth 0 -user clamav -gid 0 -print0 2>/dev/null | xargs -r -0 chown root -- 2>/dev/null || true + + # clean up rogue clamav-milter logrotate config + if [ -f /etc/logrotate.d/clamav-milter ] && + head -1 /etc/logrotate.d/clamav-milter | grep -q "^none" + then + rm -f /etc/logrotate.d/clamav-milter + fi +fi + # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. diff -u clamav-0.95.1+dfsg/debian/clamav-milter.init.in clamav-0.95.1+dfsg/debian/clamav-milter.init.in --- clamav-0.95.1+dfsg/debian/clamav-milter.init.in +++ clamav-0.95.1+dfsg/debian/clamav-milter.init.in @@ -103,8 +103,8 @@ chown $User $(dirname "$SOCKET_PATH") fi -make_dir $(dirname "$THEPIDFILE") -chown $User $(dirname "$THEPIDFILE") +make_dir $(dirname "$PIDFILE") +chown $User $(dirname "$PIDFILE") case "$1" in start) diff -u clamav-0.95.1+dfsg/debian/changelog clamav-0.95.1+dfsg/debian/changelog --- clamav-0.95.1+dfsg/debian/changelog +++ clamav-0.95.1+dfsg/debian/changelog @@ -1,3 +1,18 @@ +clamav (0.95.1+dfsg-1ubuntu1.1+ppa2) jaunty; urgency=low + + [ Imre Gergely ] + * Fixed clamav-milter init script (LP: #365823) + * Added some cleanup code to clamav-milter.postinst.in to correct + correct permissions problems + - clamav-milter init script problem + - clamav-milter postinst script problem + + [ Scott Kitterman ] + * Fix clamav-milter postinst to not try to create a logfile if the logfile + is defined as 'none' + + -- Scott Kitterman Fri, 01 May 2009 01:01:31 -0400 + clamav (0.95.1+dfsg-1ubuntu1.1) jaunty-proposed; urgency=low * Fixed clamd apparmor profile based on pre-release testing