From fa9656200e23fc036ec7e31084e5b111e070e32e Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Apr 10 2009 21:10:04 +0000 Subject: - Upgrade to 0.95.1 (#495036, #495039) and enabled IPv6 support - Fixed typo in SysV initscript which removes 'touch' file (#473513) - Added build requirement to ncurses-devel for clamdtop --- diff --git a/.cvsignore b/.cvsignore index 336c23f..c07be39 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -clamav-0.94.2-norar.tar.bz2 +clamav-0.95.1-norar.tar.bz2 diff --git a/clamav-0.90rc3-private.patch b/clamav-0.90rc3-private.patch deleted file mode 100644 index 66b662e..0000000 --- a/clamav-0.90rc3-private.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- clamav-0.90rc3/libclamav.pc.in.private 2004-07-14 13:35:38.000000000 +0200 -+++ clamav-0.90rc3/libclamav.pc.in 2007-02-04 12:24:35.000000000 +0100 -@@ -6,6 +6,6 @@ - Name: libclamav - Description: A GPL virus scanner - Version: @LIBCLAMAV_VERSION@ --Libs: -L${libdir} -lclamav @LIBCLAMAV_LIBS@ --Cflags: -I${includedir} @CFLAGS@ -- -+Libs: -L${libdir} -lclamav -+Libs.private: -L${libdir} -lclamav @LIBCLAMAV_LIBS@ -+Cflags: -I${includedir} ---- clamav-0.90rc3/clamav-config.in.private 2004-06-06 03:50:08.000000000 +0200 -+++ clamav-0.90rc3/clamav-config.in 2007-02-04 12:25:27.000000000 +0100 -@@ -55,11 +55,11 @@ - ;; - - --cflags) -- echo -I@includedir@ @CFLAGS@ -+ echo -I@includedir@ - ;; - - --libs) -- echo -L@libdir@ @LIBCLAMAV_LIBS@ -+ echo -L@libdir@ -lclamav - ;; - - *) diff --git a/clamav-0.92-private.patch b/clamav-0.92-private.patch new file mode 100644 index 0000000..bab2948 --- /dev/null +++ b/clamav-0.92-private.patch @@ -0,0 +1,29 @@ +--- clamav-0.92/libclamav.pc.in.private ++++ clamav-0.92/libclamav.pc.in +@@ -6,6 +6,6 @@ includedir=@includedir@ + Name: libclamav + Description: A GPL virus scanner + Version: @LIBCLAMAV_VERSION@ +-Libs: -L${libdir} -lclamav @LIBCLAMAV_LIBS@ +-Cflags: -I${includedir} @CFLAGS@ +- ++Libs: -L${libdir} -lclamav ++Libs.private: -L${libdir} -lclamav @LIBCLAMAV_LIBS@ ++Cflags: -I${includedir} +--- clamav-0.92/clamav-config.in.private ++++ clamav-0.92/clamav-config.in +@@ -54,12 +54,8 @@ while test $# -gt 0; do + usage 0 + ;; + +- --cflags) +- echo -I@includedir@ @CFLAGS@ +- ;; +- +- --libs) +- echo -L@libdir@ @LIBCLAMAV_LIBS@ ++ (--cflags|--libs) ++ ${PKG_CONFIG:-pkg-config} "$1" libclamav + ;; + + *) diff --git a/clamav-0.93.1-path.patch b/clamav-0.93.1-path.patch deleted file mode 100644 index 4f1872c..0000000 --- a/clamav-0.93.1-path.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- clamav-0.93.1/contrib/init/RedHat/clamav-milter.path -+++ clamav-0.93.1/contrib/init/RedHat/clamav-milter -@@ -22,7 +22,6 @@ test -f /etc/sysconfig/clamav-milter && - # Check that networking is up. - [ ${NETWORKING} = "no" ] && exit 0 - --[ -x /usr/local/sbin/clamav-milter ] || exit 0 - PATH=$PATH:/usr/bin:/usr/local/sbin:/usr/local/bin - - RETVAL=0 -@@ -87,7 +86,7 @@ case "$1" in - restart - ;; - condrestart) -- test -f ${lockfile} && $0 restart || : -+ test -f ${lockfile} && restart || : - ;; - status) - if [ ! -z $pidfile ]; then diff --git a/clamav-0.93.3-initoff.patch b/clamav-0.93.3-initoff.patch deleted file mode 100644 index 899d32b..0000000 --- a/clamav-0.93.3-initoff.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- clamav-0.93.3/contrib/init/RedHat/clamav-milter.initoff -+++ clamav-0.93.3/contrib/init/RedHat/clamav-milter -@@ -2,7 +2,7 @@ - # - # clamav-milter This script starts and stops the clamav-milter daemon - # --# chkconfig: 2345 79 40 -+# chkconfig: - 79 40 - # - # description: clamav-milter is a daemon which hooks into sendmail and routes \ - # email messages for virus scanning with ClamAV diff --git a/clamav-0.93.3-pid.patch b/clamav-0.93.3-pid.patch deleted file mode 100644 index de29887..0000000 --- a/clamav-0.93.3-pid.patch +++ /dev/null @@ -1,17 +0,0 @@ -Try to fix https://bugzilla.redhat.com/show_bug.cgi?id=452359; RH/Fedora -initscripts do not support killing of whole processgroups. Hence, disable -feature which posts negative pgrp into pidfile and use plain pid instead -of. - -diff -up clamav-0.93.3/clamav-milter/clamav-milter.c.~1~ clamav-0.93.3/clamav-milter/clamav-milter.c ---- clamav-0.93.3/clamav-milter/clamav-milter.c.~1~ 2008-07-07 20:02:10.000000000 +0200 -+++ clamav-0.93.3/clamav-milter/clamav-milter.c 2008-07-13 20:15:12.000000000 +0200 -@@ -1985,7 +1985,7 @@ main(int argc, char **argv) - logg(_("!Can't save PID in file %s\n"), pidfile); - return EX_CONFIG; - } --#ifdef C_LINUX -+#if defined(C_LINUX) && 0 - /* Ensure that all threads are kill()ed */ - fprintf(fd, "-%d\n", (int)getpgrp()); - #else diff --git a/clamav-0.95-cliopts.patch b/clamav-0.95-cliopts.patch new file mode 100644 index 0000000..90d173f --- /dev/null +++ b/clamav-0.95-cliopts.patch @@ -0,0 +1,13 @@ +Index: clamav-0.95rc1/shared/optparser.c +=================================================================== +--- clamav-0.95rc1.orig/shared/optparser.c ++++ clamav-0.95rc1/shared/optparser.c +@@ -211,7 +211,7 @@ const struct clam_option clam_options[] + + { "ExitOnOOM", NULL, 0, TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD, "Stop the daemon when libclamav reports an out of memory condition.", "yes" }, + +- { "Foreground", NULL, 0, TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_FRESHCLAM | OPT_MILTER, "Don't fork into background.", "no" }, ++ { "Foreground", "nofork", 0, TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_FRESHCLAM | OPT_MILTER, "Don't fork into background.", "no" }, + + { "Debug", NULL, 0, TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_FRESHCLAM, "Enable debug messages in libclamav.", "no" }, + diff --git a/clamav-0.95rc1-umask.patch b/clamav-0.95rc1-umask.patch new file mode 100644 index 0000000..8a46216 --- /dev/null +++ b/clamav-0.95rc1-umask.patch @@ -0,0 +1,39 @@ +Index: clamav-0.95rc1/clamav-milter/clamav-milter.c +=================================================================== +--- clamav-0.95rc1.orig/clamav-milter/clamav-milter.c ++++ clamav-0.95rc1/clamav-milter/clamav-milter.c +@@ -287,7 +287,7 @@ int main(int argc, char **argv) { + + if((opt = optget(opts, "PidFile"))->enabled) { + FILE *fd; +- mode_t old_umask = umask(0006); ++ mode_t old_umask = umask(0022); + + if((fd = fopen(opt->strarg, "w")) == NULL) { + logg("!Can't save PID in file %s\n", opt->strarg); +Index: clamav-0.95rc1/shared/output.c +=================================================================== +--- clamav-0.95rc1.orig/shared/output.c ++++ clamav-0.95rc1/shared/output.c +@@ -250,7 +250,7 @@ int logg(const char *str, ...) + #endif + if(logg_file) { + if(!logg_fp) { +- old_umask = umask(0037); ++ old_umask = umask(0077); + if((logg_fp = fopen(logg_file, "at")) == NULL) { + umask(old_umask); + #ifdef CL_THREAD_SAFE +Index: clamav-0.95rc1/freshclam/freshclam.c +=================================================================== +--- clamav-0.95rc1.orig/freshclam/freshclam.c ++++ clamav-0.95rc1/freshclam/freshclam.c +@@ -102,7 +102,7 @@ static void writepid(const char *pidfile + { + FILE *fd; + int old_umask; +- old_umask = umask(0006); ++ old_umask = umask(0022); + if((fd = fopen(pidfile, "w")) == NULL) { + logg("!Can't save PID to file %s: %s\n", pidfile, strerror(errno)); + } else { diff --git a/clamav-milter.sysv b/clamav-milter.sysv new file mode 100644 index 0000000..7c06c60 --- /dev/null +++ b/clamav-milter.sysv @@ -0,0 +1,103 @@ +#!/bin/sh +# +# clamav-milter This script starts and stops the clamav-milter daemon +# +# chkconfig: - 79 40 +# +# description: clamav-milter is a daemon which hooks into sendmail and routes \ +# email messages for virus scanning with ClamAV +# processname: clamav-milter +# pidfile: /var/lock/subsys/clamav-milter + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +# Local clamav-milter config +CLAMAV_FLAGS= +test -f /etc/sysconfig/clamav-milter && . /etc/sysconfig/clamav-milter + +# Check that networking is up. +[ ${NETWORKING} = "no" ] && exit 0 + +PATH=$PATH:/usr/bin:/usr/local/sbin:/usr/local/bin + +RETVAL=0 + +# Clamav-milter must have write access to the pid file, /var/run is not suitable +default_pidfile= +[ -d /var/run/clamav-milter ] && default_pidfile=/var/run/clamav-milter/clamav-milter.pid +[ -d /var/clamav ] && default_pidfile=/var/clamav/clamav-milter.pid +pidfile=${PIDFILE:-$default_pidfile} + +lockfile=/var/lock/subsys/clamav-milter + +start() { + echo -n "Starting clamav-milter: " + # Don't allow files larger than 25M to be created, to limit DoS + # Needs to be large enough to extract the signature files + ulimit -f 25600 + if [ ! -z $pidfile ]; then + CLAMAV_PID=--pidfile=${pidfile} + PID=`pidofproc -p ${pidfile} clamav-milter` + else + CLAMAV_PID= + PID=`pidofproc clamav-milter` + fi + [ -n "$PID" ] && echo " already running!" && return 1 + LANG= daemon clamav-milter $CLAMAV_PID ${CLAMAV_FLAGS} + RETVAL=$? + [ ! -z $pidfile -a -f $pidfile ] && sed -i -e 's/-//' $pidfile + echo + test $RETVAL -eq 0 && touch ${lockfile} + return $RETVAL +} + +stop() { + echo -n "Shutting down clamav-milter: " + if [ ! -z $pidfile ]; then + killproc -p ${pidfile} clamav-milter + else + killproc clamav-milter + fi + RETVAL=$? + echo + test $RETVAL -eq 0 && rm -f ${lockfile} ${pidfile} +} + +restart() { + stop + start +} + +# See how we were called. +case "$1" in + start) + # Start daemon. + start + ;; + stop) + # Stop daemon. + stop + ;; + restart|reload) + restart + ;; + condrestart) + test -f ${lockfile} && restart || : + ;; + status) + if [ ! -z $pidfile ]; then + status -p ${pidfile} clamav-milter + else + status clamav-milter + fi + ;; + *) + echo "Usage: $0 {start|stop|reload|restart|condrestart|status}" + exit 1 +esac + +exit $? diff --git a/clamav.spec b/clamav.spec index 4fe1dee..3f5dea1 100644 --- a/clamav.spec +++ b/clamav.spec @@ -15,7 +15,7 @@ Summary: End-user tools for the Clam Antivirus scanner Name: clamav -Version: 0.94.2 +Version: 0.95.1 Release: %release_func 1 License: GPLv2 @@ -25,7 +25,7 @@ URL: http://www.clamav.net # incompatible unrar from RARlabs. We have to pull this code out. # tarball was created by # make clean-sources [TARBALL=] [VERSION=] -Source0: clamav-%{version}-norar.tar.bz2 +Source0: %name-%version-norar.tar.bz2 # Source0: http://download.sourceforge.net/sourceforge/clamav/%name-%version.tar.gz # No sense in using this file for the time being. # Source999: http://download.sourceforge.net/sourceforge/clamav/%name-%version.tar.gz.sig @@ -36,15 +36,15 @@ Source5: clamd-README Source6: clamav-update.logrotate Source7: clamd.SERVICE.init Source8: clamav-notify-servers -Patch21: clamav-0.93.1-path.patch -Patch22: clamav-0.93.3-initoff.patch -Patch24: clamav-0.90rc3-private.patch +Patch24: clamav-0.92-private.patch Patch25: clamav-0.92-open.patch -Patch26: clamav-0.93.3-pid.patch +Patch26: clamav-0.95-cliopts.patch +Patch27: clamav-0.95rc1-umask.patch BuildRoot: %_tmppath/%name-%version-%release-root Requires: clamav-lib = %version-%release Requires: data(clamav) BuildRequires: zlib-devel bzip2-devel gmp-devel curl-devel +BuildRequires: ncurses-devel BuildRequires: %_includedir/tcpd.h BuildRequires: bc @@ -71,6 +71,7 @@ Source100: clamd-gen Requires: clamav-lib = %version-%release Requires: clamav-filesystem = %version-%release Requires(pre): %_libdir/pkgconfig +Requires: pkgconfig %package data Summary: Virus signature data for the Clam Antivirus scanner @@ -131,6 +132,7 @@ Requires(post): coreutils %package milter-sysv Summary: SysV initscripts for the clamav sendmail-milter Group: System Environment/Daemons +Source320: clamav-milter.sysv Provides: init(clamav-milter) = sysv Requires: clamav-milter = %version-%release Requires(post): user(%milteruser) clamav-milter @@ -229,23 +231,24 @@ The SysV initscripts for clamav-milter. %prep %setup -q -%patch21 -p1 -b .path -%patch22 -p1 -b .initoff %patch24 -p1 -b .private %patch25 -p1 -b .open -%patch26 -p1 -b .pid +%patch26 -p1 -b .cliopts +%patch27 -p1 -b .umask mkdir -p libclamunrar{,_iface} touch libclamunrar/{Makefile.in,all,install} -perl -pi -e 's!^(#?LogFile ).*!\1/var/log/clamd.!g; - s!^#?(LocalSocket ).*!\1/var/run/clamd./clamd.sock!g; - s!^#?(PidFile ).*!\1/var/run/clamd./clamd.pid!g; - s!^#?(User ).*!\1!g; - s! /usr/local/share/clamav,! %homedir,!g; - ' etc/clamd.conf +sed -ri \ + -e 's!^(#?LogFile ).*!\1/var/log/clamd.!g' \ + -e 's!^(#?LocalSocket ).*!\1/var/run/clamd./clamd.sock!g' \ + -e 's!^(#?PidFile ).*!\1/var/run/clamd./clamd.pid!g' \ + -e 's!^#?(User ).*!\1!g' \ + -e 's!^#?(AllowSupplementaryGroups|LogSyslog).*!\1 yes!g' \ + -e 's! /usr/local/share/clamav,! %homedir,!g' \ + etc/clamd.conf -perl -pi -e 's!^#(UpdateLogFile )!\1!g;' etc/freshclam.conf +sed -ri -e 's!^#(UpdateLogFile )!\1!g;' etc/freshclam.conf ## ------------------------------------------------------------ @@ -255,12 +258,17 @@ CFLAGS="$RPM_OPT_FLAGS -Wall -W -Wmissing-prototypes -Wmissing-declarations -std export LDFLAGS='-Wl,--as-needed' # HACK: remove me, when configure uses $LIBS instead of $LDFLAGS for milter check export LIBS='-lmilter -lpthread' -%configure --disable-clamav --with-dbdir=/var/lib/clamav \ - --enable-milter --disable-static --disable-unrar -sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool -# No rpath -sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool -sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool +# IPv6 check is buggy and does not work when there are no IPv6 interface on build machine +export have_cv_ipv6=yes +%configure --disable-clamav --with-dbdir=/var/lib/clamav \ + --enable-milter --disable-static \ + --disable-rpath --disable-unrar + +# build with --as-needed and disable rpath +sed -i \ + -e 's! -shared ! -Wl,--as-needed\0!g' \ + -e '/sys_lib_dlsearch_path_spec=\"\/lib \/usr\/lib /s!\"\/lib \/usr\/lib !/\"/%_lib /usr/%_lib !g' \ + libtool make %{?_smp_mflags} @@ -297,6 +305,7 @@ install -d -m755 \ rm -f ${RPM_BUILD_ROOT}%_sysconfdir/clamd.conf \ ${RPM_BUILD_ROOT}%_libdir/*.la + touch ${RPM_BUILD_ROOT}%homedir/daily.cld touch ${RPM_BUILD_ROOT}%homedir/main.cld @@ -348,7 +357,8 @@ cat <$RPM_BUILD_ROOT%_sysconfdir/sysconfig/clamav-milter CLAMAV_FLAGS='-lo -c /etc/clamd.d/milter.conf local:%milterstatedir/clamav.sock' EOF -install -p -m755 contrib/init/RedHat/clamav-milter $RPM_BUILD_ROOT%_initrddir/clamav-milter +install -p -m 755 %SOURCE320 $RPM_BUILD_ROOT%_initrddir/clamav-milter +rm -f $RPM_BUILD_ROOT%_sysconfdir/clamav-milter.conf touch $RPM_BUILD_ROOT%milterstatedir/clamav.sock $RPM_BUILD_ROOT%milterlog @@ -455,6 +465,7 @@ test "$1" = 0 || %_initrddir/clamav-milter condrestart >/dev/null || : %defattr(-,%username,%username,-) %ghost %attr(0664,%username,%username) %homedir/*.cvd + ## ----------------------- %files update @@ -468,7 +479,6 @@ test "$1" = 0 || %_initrddir/clamav-milter condrestart >/dev/null || : %config(noreplace) %_sysconfdir/sysconfig/freshclam %ghost %attr(0664,root,%username) %verify(not size md5 mtime) %freshclamlog - %ghost %attr(0664,%username,%username) %homedir/*.cld @@ -495,13 +505,12 @@ test "$1" = 0 || %_initrddir/clamav-milter condrestart >/dev/null || : %files milter %defattr(-,root,root,-) -%doc clamav-milter/INSTALL %_sbindir/*milter* %_mandir/man8/clamav-milter* %config(noreplace) %verify(not mtime) %_sysconfdir/clamd.d/milter.conf -%attr(0700,%milteruser,%milteruser) %dir %milterstatedir -%ghost %milterstatedir/* %ghost %attr(0620,root,%milteruser) %verify(not size md5 mtime) %milterlog +%attr(0710,%milteruser,%milteruser) %dir %milterstatedir +%ghost %milterstatedir/* %files milter-sysv @@ -511,6 +520,11 @@ test "$1" = 0 || %_initrddir/clamav-milter condrestart >/dev/null || : %changelog +* Fri Apr 10 2009 Robert Scheck - 0.95.1-1 +- Upgrade to 0.95.1 (#495036, #495039) and enabled IPv6 support +- Fixed typo in SysV initscript which removes 'touch' file (#473513) +- Added build requirement to ncurses-devel for clamdtop + * Tue Dec 02 2008 Robert Scheck - 0.94.2-1 - Upgrade to 0.94.2 (#474002) diff --git a/clamd-wrapper b/clamd-wrapper index 372005f..14c04a5 100644 --- a/clamd-wrapper +++ b/clamd-wrapper @@ -28,7 +28,7 @@ CLAMD_CONFIGFILE=/etc/clamd.d/${CLAMD_SERVICE}.conf CLAMD_OPTIONS= ## backward-compatibility check... for i in /var/run/clamd.${CLAMD_SERVICE}/clamd.sock \ - /var/run/clamav.${CLAMD_SERVICE}/clamd.sock; do + /var/run/clamav.${CLAMD_SERVICE}/clamd.sock; do CLAMD_SOCKET=$i test ! -e "$i" || break done @@ -52,7 +52,7 @@ stop () { killproc $procname RETVAL=$? echo - [ $RETVAL -eq 0 ] && rm -f touch $lockfile + [ $RETVAL -eq 0 ] && rm -f $lockfile return $RETVAL } diff --git a/sources b/sources index e115b9a..acd143c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9b04d010c17c607ace4ed5e9318104d4 clamav-0.94.2-norar.tar.bz2 +0ddd9f341dd0299a6bc5398ee26f4ebf clamav-0.95.1-norar.tar.bz2