diff --git a/clamav-check.patch b/clamav-check.patch new file mode 100644 index 0000000..e3d37a4 --- /dev/null +++ b/clamav-check.patch @@ -0,0 +1,12 @@ +diff -up clamav-0.103.0/unit_tests/check_jsnorm.c.check clamav-0.103.0/unit_tests/check_jsnorm.c +--- clamav-0.103.0/unit_tests/check_jsnorm.c.check 2020-09-12 18:27:10.000000000 -0600 ++++ clamav-0.103.0/unit_tests/check_jsnorm.c 2020-09-17 22:15:26.199957518 -0600 +@@ -247,7 +247,7 @@ static void tokenizer_test(const char *i + fd = open(filename, O_RDONLY); + if (fd < 0) { + jstest_teardown(); +- ck_assert_msg("failed to open output file: %s", filename); ++ ck_assert_msg(0, "failed to open output file: %s", filename); + } + + diff_file_mem(fd, expected, len); diff --git a/clamav-clamonacc-service.patch b/clamav-clamonacc-service.patch new file mode 100644 index 0000000..bdac52d --- /dev/null +++ b/clamav-clamonacc-service.patch @@ -0,0 +1,20 @@ +diff -up clamav-0.103.0/clamonacc/clamav-clamonacc.service.in.clamonacc-service clamav-0.103.0/clamonacc/clamav-clamonacc.service.in +--- clamav-0.103.0/clamonacc/clamav-clamonacc.service.in.clamonacc-service 2020-09-12 18:27:09.000000000 -0600 ++++ clamav-0.103.0/clamonacc/clamav-clamonacc.service.in 2020-09-18 19:49:35.400152760 -0600 +@@ -4,14 +4,12 @@ + [Unit] + Description=ClamAV On-Access Scanner + Documentation=man:clamonacc(8) man:clamd.conf(5) https://www.clamav.net/documents +-Requires=clamav-daemon.service +-After=clamav-daemon.service syslog.target network.target ++After=clamd@scan.service syslog.target network.target + + [Service] + Type=simple + User=root +-ExecStartPre=/bin/bash -c "while [ ! -S /run/clamav/clamd.ctl ]; do sleep 1; done" +-ExecStart=@prefix@/sbin/clamonacc -F --config-file=@APP_CONFIG_DIRECTORY@/clamd.conf --log=/var/log/clamav/clamonacc.log --move=/root/quarantine ++ExecStart=@prefix@/sbin/clamonacc -F --config-file=/etc/clamd.d/scan.conf + + [Install] + WantedBy=multi-user.target diff --git a/clamav-clean.sh b/clamav-clean.sh index 6379c3f..a2babd2 100755 --- a/clamav-clean.sh +++ b/clamav-clean.sh @@ -1,4 +1,4 @@ -VERSION=0.102.4 +VERSION=0.103.0 NAME=clamav TARBALL_CLEAN=${NAME}-${VERSION}-norar.tar.xz TARBALL=${NAME}-${VERSION}.tar.gz diff --git a/clamav-curl.patch b/clamav-curl.patch deleted file mode 100644 index 6f9fe74..0000000 --- a/clamav-curl.patch +++ /dev/null @@ -1,56 +0,0 @@ -diff -up clamav-0.102.2/clamonacc/client/communication.c.curl clamav-0.102.2/clamonacc/client/communication.c ---- clamav-0.102.2/clamonacc/client/communication.c.curl 2020-02-04 07:59:26.000000000 -0700 -+++ clamav-0.102.2/clamonacc/client/communication.c 2020-04-29 21:44:45.073020203 -0600 -@@ -42,12 +42,12 @@ - - #include "communication.h" - --static int onas_socket_wait(curl_socket_t sockfd, int32_t b_recv, uint64_t timeout_ms); -+static int onas_socket_wait(long sockfd, int32_t b_recv, uint64_t timeout_ms); - - /** - * Function from curl example code, Copyright (C) 1998 - 2018, Daniel Stenberg, see COPYING.curl for license details - */ --static int onas_socket_wait(curl_socket_t sockfd, int32_t b_recv, uint64_t timeout_ms) -+static int onas_socket_wait(long sockfd, int32_t b_recv, uint64_t timeout_ms) - { - struct timeval tv; - fd_set infd, outfd, errfd; -@@ -79,9 +79,9 @@ int onas_sendln(CURL *curl, const void * - { - size_t sent = 0; - CURLcode curlcode; -- curl_socket_t sockfd; -+ long sockfd; - -- curlcode = curl_easy_getinfo(curl, CURLINFO_ACTIVESOCKET, &sockfd); -+ curlcode = curl_easy_getinfo(curl, CURLINFO_LASTSOCKET, &sockfd); - - if (CURLE_OK != curlcode) { - logg("!ClamCom: could not get curl active socket info %s\n", curl_easy_strerror(curlcode)); -@@ -137,9 +137,9 @@ int onas_recvln(struct RCVLN *rcv_data, - { - char *eol; - int ret = 0; -- curl_socket_t sockfd; -+ long sockfd; - -- rcv_data->curlcode = curl_easy_getinfo(rcv_data->curl, CURLINFO_ACTIVESOCKET, &sockfd); -+ rcv_data->curlcode = curl_easy_getinfo(rcv_data->curl, CURLINFO_LASTSOCKET, &sockfd); - - if (CURLE_OK != rcv_data->curlcode) { - logg("!ClamCom: could not get curl active socket info %s\n", curl_easy_strerror(rcv_data->curlcode)); -diff -up clamav-0.102.2/m4/reorganization/libs/curl.m4.curl clamav-0.102.2/m4/reorganization/libs/curl.m4 ---- clamav-0.102.2/m4/reorganization/libs/curl.m4.curl 2020-02-04 07:59:26.000000000 -0700 -+++ clamav-0.102.2/m4/reorganization/libs/curl.m4 2020-04-29 21:36:15.043808045 -0600 -@@ -62,8 +62,8 @@ if test "X$have_curl" = "Xyes"; then - dnl end of section - - AM_COND_IF([BUILD_CLAMONACC], -- dnl if version greater than (7.45) -- [if test $curl_version -ge 470272 ; then -+ dnl if version greater than (7.29) -+ [if test $curl_version -ge 466176 ; then - $enable_clamonacc="yes" - else - AC_MSG_ERROR([m4_normalize([ diff --git a/clamav-default_confs.patch b/clamav-default_confs.patch index 481c9ce..97bbc10 100644 --- a/clamav-default_confs.patch +++ b/clamav-default_confs.patch @@ -1,7 +1,7 @@ -diff -up clamav-0.102.0/clamconf/clamconf.c.default_confs clamav-0.102.0/clamconf/clamconf.c ---- clamav-0.102.0/clamconf/clamconf.c.default_confs 2019-10-11 20:46:32.216962895 -0600 -+++ clamav-0.102.0/clamconf/clamconf.c 2019-10-11 20:47:16.201174669 -0600 -@@ -60,9 +60,9 @@ static struct _cfgfile { +diff -up clamav-0.103.0/clamconf/clamconf.c.default_confs clamav-0.103.0/clamconf/clamconf.c +--- clamav-0.103.0/clamconf/clamconf.c.default_confs 2020-09-12 18:27:09.000000000 -0600 ++++ clamav-0.103.0/clamconf/clamconf.c 2020-09-17 22:00:20.792879792 -0600 +@@ -63,9 +63,9 @@ static struct _cfgfile { const char *name; int tool; } cfgfile[] = { @@ -13,9 +13,9 @@ diff -up clamav-0.102.0/clamconf/clamconf.c.default_confs clamav-0.102.0/clamcon {NULL, 0}}; static void printopts(struct optstruct *opts, int nondef) -diff -up clamav-0.102.0/docs/man/clamav-milter.8.in.default_confs clamav-0.102.0/docs/man/clamav-milter.8.in ---- clamav-0.102.0/docs/man/clamav-milter.8.in.default_confs 2019-10-01 11:24:08.000000000 -0600 -+++ clamav-0.102.0/docs/man/clamav-milter.8.in 2019-10-11 20:46:32.218962904 -0600 +diff -up clamav-0.103.0/docs/man/clamav-milter.8.in.default_confs clamav-0.103.0/docs/man/clamav-milter.8.in +--- clamav-0.103.0/docs/man/clamav-milter.8.in.default_confs 2020-09-12 18:27:09.000000000 -0600 ++++ clamav-0.103.0/docs/man/clamav-milter.8.in 2020-09-17 22:00:20.793879800 -0600 @@ -27,7 +27,7 @@ Print the version number and exit. Read configuration from FILE. .SH "FILES" @@ -25,9 +25,9 @@ diff -up clamav-0.102.0/docs/man/clamav-milter.8.in.default_confs clamav-0.102.0 .SH "AUTHOR" .LP aCaB -diff -up clamav-0.102.0/docs/man/clamav-milter.conf.5.in.default_confs clamav-0.102.0/docs/man/clamav-milter.conf.5.in ---- clamav-0.102.0/docs/man/clamav-milter.conf.5.in.default_confs 2019-10-01 11:24:08.000000000 -0600 -+++ clamav-0.102.0/docs/man/clamav-milter.conf.5.in 2019-10-11 20:46:32.218962904 -0600 +diff -up clamav-0.103.0/docs/man/clamav-milter.conf.5.in.default_confs clamav-0.103.0/docs/man/clamav-milter.conf.5.in +--- clamav-0.103.0/docs/man/clamav-milter.conf.5.in.default_confs 2020-09-12 18:27:09.000000000 -0600 ++++ clamav-0.103.0/docs/man/clamav-milter.conf.5.in 2020-09-17 22:00:20.794879808 -0600 @@ -239,7 +239,7 @@ Default: no All options expressing a size are limited to max 4GB. Values in excess will be reset to the maximum. .SH "FILES" @@ -37,9 +37,9 @@ diff -up clamav-0.102.0/docs/man/clamav-milter.conf.5.in.default_confs clamav-0. .SH "AUTHOR" .LP aCaB -diff -up clamav-0.102.0/docs/man/clamd.8.in.default_confs clamav-0.102.0/docs/man/clamd.8.in ---- clamav-0.102.0/docs/man/clamd.8.in.default_confs 2019-10-01 11:24:08.000000000 -0600 -+++ clamav-0.102.0/docs/man/clamd.8.in 2019-10-11 20:46:32.220962914 -0600 +diff -up clamav-0.103.0/docs/man/clamd.8.in.default_confs clamav-0.103.0/docs/man/clamd.8.in +--- clamav-0.103.0/docs/man/clamd.8.in.default_confs 2020-09-12 18:27:09.000000000 -0600 ++++ clamav-0.103.0/docs/man/clamd.8.in 2020-09-17 22:00:20.794879808 -0600 @@ -7,7 +7,7 @@ clamd \- an anti\-virus daemon clamd [options] .SH "DESCRIPTION" @@ -58,30 +58,30 @@ diff -up clamav-0.102.0/docs/man/clamd.8.in.default_confs clamav-0.102.0/docs/ma .SH "CREDITS" Please check the full documentation for credits. .SH "AUTHOR" -diff -up clamav-0.102.0/docs/man/clamd.conf.5.in.default_confs clamav-0.102.0/docs/man/clamd.conf.5.in ---- clamav-0.102.0/docs/man/clamd.conf.5.in.default_confs 2019-10-01 11:24:08.000000000 -0600 -+++ clamav-0.102.0/docs/man/clamd.conf.5.in 2019-10-11 20:46:32.219962909 -0600 -@@ -742,7 +742,7 @@ Default: no +diff -up clamav-0.103.0/docs/man/clamd.conf.5.in.default_confs clamav-0.103.0/docs/man/clamd.conf.5.in +--- clamav-0.103.0/docs/man/clamd.conf.5.in.default_confs 2020-09-17 22:00:20.795879816 -0600 ++++ clamav-0.103.0/docs/man/clamd.conf.5.in 2020-09-17 22:01:21.414353121 -0600 +@@ -759,7 +759,7 @@ Default: no All options expressing a size are limited to max 4GB. Values in excess will be reset to the maximum. .SH "FILES" - .LP + .LP -@CFGDIR@/clamd.conf +@CFGDIR@/clamd.d/scan.conf .SH "AUTHORS" - .LP + .LP Tomasz Kojm , Kevin Lin -diff -up clamav-0.102.0/platform.h.in.default_confs clamav-0.102.0/platform.h.in ---- clamav-0.102.0/platform.h.in.default_confs 2019-10-01 11:24:09.000000000 -0600 -+++ clamav-0.102.0/platform.h.in 2019-10-11 20:46:32.217962899 -0600 -@@ -34,9 +34,9 @@ typedef unsigned int in_addr_t; - #define PATHSEP "/" +diff -up clamav-0.103.0/platform.h.in.default_confs clamav-0.103.0/platform.h.in +--- clamav-0.103.0/platform.h.in.default_confs 2020-09-17 22:00:20.796879824 -0600 ++++ clamav-0.103.0/platform.h.in 2020-09-17 22:01:56.842629739 -0600 +@@ -112,9 +112,9 @@ typedef unsigned int in_addr_t; #endif + #ifndef _WIN32 -#define CONFDIR_CLAMD CONFDIR PATHSEP "clamd.conf" +#define CONFDIR_CLAMD CONFDIR PATHSEP "clamd.d/scan.conf" #define CONFDIR_FRESHCLAM CONFDIR PATHSEP "freshclam.conf" -#define CONFDIR_MILTER CONFDIR PATHSEP "clamav-milter.conf" +#define CONFDIR_MILTER CONFDIR PATHSEP "mail/clamav-milter.conf" + #endif - #define cli_to_utf8_maybe_alloc(x) (x) - #define cli_strdup_to_utf8(x) strdup(x) + #ifndef WORDS_BIGENDIAN diff --git a/clamav.spec b/clamav.spec index fe32234..1d4042a 100644 --- a/clamav.spec +++ b/clamav.spec @@ -34,13 +34,14 @@ %global milterlog %_var/log/clamav-milter.log %global milterstatedir %_rundir/clamav-milter %global pkgdatadir %_datadir/%name +%global quarantinedir %_var/spool/quarantine %global scanuser clamscan %global scanstatedir %_rundir/clamd.scan Summary: End-user tools for the Clam Antivirus scanner Name: clamav -Version: 0.102.4 +Version: 0.103.0 Release: 1%{?dist} License: %{?with_unrar:proprietary}%{!?with_unrar:GPLv2} URL: https://www.clamav.net/ @@ -64,11 +65,9 @@ Source5: clamd-README #http://database.clamav.net/main.cvd Source10: main-59.cvd #http://database.clamav.net/daily.cvd -Source11: daily-25876.cvd +Source11: daily-25931.cvd #http://database.clamav.net/bytecode.cvd Source12: bytecode-331.cvd -#for clamonacc -Source100: clamonacc.service #for update Source200: freshclam-sleep Source201: freshclam.sysconfig @@ -89,19 +88,26 @@ Patch0: clamav-stats-deprecation.patch Patch1: clamav-default_confs.patch # Fix pkg-config flags for static linking, multilib Patch2: clamav-0.99-private.patch -# Patch to use EL7 libcurl -Patch3: clamav-curl.patch +# Fix ck_assert_msg() call +# https://github.com/Cisco-Talos/clamav-devel/pull/138 +Patch4: clamav-check.patch +# Modify clamav-clamonacc.service for Fedora compatibility +Patch5: clamav-clamonacc-service.patch -BuildRequires: autoconf automake gettext-devel libtool libtool-ltdl-devel +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: gettext-devel +BuildRequires: libtool +BuildRequires: libtool-ltdl-devel BuildRequires: gcc-c++ BuildRequires: bzip2-devel BuildRequires: curl-devel BuildRequires: gmp-devel BuildRequires: json-c-devel BuildRequires: libprelude-devel -# libprelude-config --libs brings in gnutls +# libprelude-config --libs brings in gnutls, pcre # https://bugzilla.redhat.com/show_bug.cgi?id=1830473 -BuildRequires: gnutls-devel +BuildRequires: gnutls-devel pcre-devel BuildRequires: libxml2-devel BuildRequires: ncurses-devel BuildRequires: openssl-devel @@ -119,6 +125,7 @@ BuildRequires: nc BuildRequires: systemd-devel #for milter BuildRequires: sendmail-devel +BuildRequires: make Requires: clamav-filesystem = %version-%release Requires: clamav-lib = %version-%release @@ -251,8 +258,8 @@ This package contains files which are needed to run the clamav-milter. %endif %patch1 -p1 -b .default_confs %patch2 -p1 -b .private -# Patch to use older libcurl -%{?el7:%patch3 -p1 -b .curl} +%patch4 -p1 -b .check +%patch5 -p1 -b .clamonacc-service install -p -m0644 %SOURCE300 clamav-milter/ @@ -308,6 +315,7 @@ install -d -m 0755 \ $RPM_BUILD_ROOT%_var/log \ $RPM_BUILD_ROOT%milterstatedir \ $RPM_BUILD_ROOT%homedir \ + $RPM_BUILD_ROOT%quarantinedir \ $RPM_BUILD_ROOT%scanstatedir rm -f $RPM_BUILD_ROOT%_libdir/*.la @@ -325,9 +333,10 @@ install -D -m 0644 -p %SOURCE5 _doc_server/README ## Fixup URL for EPEL %{?epel:sed -i -e s/product=Fedora/product=Fedora%20EPEL/ _doc_server/README} -install -D -p -m 0644 %SOURCE100 $RPM_BUILD_ROOT%_unitdir/clamonacc.service +## For compatibility with 0.102.2-7 +ln -s clamav-clamonacc.service $RPM_BUILD_ROOT%_unitdir/clamonacc.service -install -D -p -m 0644 %SOURCE530 $RPM_BUILD_ROOT%_unitdir/clamd@.service +install -D -p -m 0644 %SOURCE530 $RPM_BUILD_ROOT%_unitdir/clamd@.service ## prepare the update-files install -D -m 0644 -p %SOURCE203 $RPM_BUILD_ROOT%_sysconfdir/logrotate.d/clamav-update @@ -419,13 +428,13 @@ make check %post -%systemd_post clamonacc.service +%systemd_post clamav-clamonacc.service %preun -%systemd_preun clamonacc.service +%systemd_preun clamav-clamonacc.service %postun -%systemd_postun_with_restart clamonacc.service +%systemd_postun_with_restart clamav-clamonacc.service %pre filesystem @@ -523,16 +532,19 @@ fi %_bindir/clamconf %_bindir/clamdscan %_bindir/clamdtop -%if %{with clamonacc} -%_bindir/clamonacc -%endif %_bindir/clamscan %_bindir/clamsubmit %_bindir/sigtool +%if %{with clamonacc} +%_sbindir/clamonacc +%endif %_mandir/man[15]/* +%_mandir/man8/clamonacc.8* %exclude %_mandir/*/freshclam* %exclude %_mandir/man5/clamd.conf.5* %_unitdir/clamonacc.service +%_unitdir/clamav-clamonacc.service +%attr(0750,root,root) %dir %quarantinedir %files lib @@ -617,6 +629,12 @@ fi %changelog +* Thu Sep 17 2020 Orion Poplawski - 0.103.0-1 +- Update to 0.103.0 + +* Mon Jul 27 2020 Fedora Release Engineering - 0.102.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Fri Jul 17 2020 Orion Poplawski - 0.102.4-1 - Update to 0.102.4 (bz#1857867,1858262,1858263,1858265,1858266) - Security fixes CVE-2020-3327 CVE-2020-3350 CVE-2020-3481 diff --git a/clamonacc.service b/clamonacc.service deleted file mode 100644 index f1ff7eb..0000000 --- a/clamonacc.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Clam AntiVirus userspace daemon for OnAccess Scanning -Documentation=man:clamd(8) man:clamd.conf(5) https://www.clamav.net/documents/ -ConditionPathExists=/etc/clamd.d/scan.conf -After=clamd@scan.service - -[Service] -ExecStart=/usr/bin/clamonacc --foreground - -[Install] -WantedBy=multi-user.target diff --git a/sources b/sources index 45995f5..588fc6c 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ -SHA512 (clamav-0.102.4-norar.tar.xz) = 202bf77edac1c6880b51981ef2508b90b935f9da62d235620ca457eaaa613ef3f1ac48ea3908f53bbc1a10cf204d9973cbe447cb2d96c1724b68eb3ef8cf4b80 +SHA512 (clamav-0.103.0-norar.tar.xz) = e1eaa9efc4e5156dd9ebec72f1ddfd55d230596157ca91bf2ea93ee198ebaf24da601a7478c11b67147a9e7c0eb469cc3acd6ef6be339f114554f994af87bb0a SHA512 (bytecode-331.cvd) = 41957106337cb28fd0eb6459bd70ab23b4ce218b3691d592e0f1bc14841696b36b1fbbc4feaef64f7b572b6cbe400f5d44fc4efedd07afe37921a9044a1a8f53 -SHA512 (daily-25876.cvd) = dd3ae3b1a95976014adeacf63574b7662212668676b0fc6a6d6f52bbb3c576e0c6e1188d6e8431ddd8da787e71de6d2e5ac25cfce9e824f41d7c271f16bcba9d +SHA512 (daily-25931.cvd) = c63571e2e8e71346c0ed5573e91644e331cbfcfe955d543f6081ae2cb6a99f5ef2b4ddd10844c5d67facbd841566e87881ef27f515c329008b90e86b6a620fba SHA512 (main-59.cvd) = c01792bdb9e07889af04ead91ba49f440cd4510b81b1c83bdfb10c65f099cf29416699f5485cc13b07c4d24195c81abc0b1c4439f5ba6d5d391b7406ba9fe26c