diff --git a/cyrus-imapd.spec b/cyrus-imapd.spec index 028a750..ca2cef4 100644 --- a/cyrus-imapd.spec +++ b/cyrus-imapd.spec @@ -9,7 +9,7 @@ Name: cyrus-imapd Version: 3.0.5 -Release: 8%{?dist} +Release: 9%{?dist} %define ssl_pem_file /etc/pki/%name/%name.pem @@ -53,6 +53,9 @@ Patch7: https://github.com/cyrusimap/cyrus-imapd/commit/7214a7e3a60c628575a73dab # vzic uses an old makefile that needs hacks to use the proper flags Patch8: patch-vzic-proper-cflags +# Fix build with clamav 0.101 +Patch9: patch-clamav101 + Source10: cyrus-imapd.logrotate Source11: cyrus-imapd.pam-config Source12: cyrus-imapd.sysconfig @@ -638,6 +641,9 @@ getent passwd cyrus >/dev/null || /usr/sbin/useradd -c "Cyrus IMAP Server" -d /v %changelog +* Mon Jan 14 2019 Jason L Tibbitts III - 3.0.5-9 +- Add patch to handle the new ClamAV API and allow a rebuild. + * Thu Mar 01 2018 Jason L Tibbitts III - 3.0.5-8 - Bump client_timeout value in test suite. diff --git a/patch-clamav101 b/patch-clamav101 new file mode 100644 index 0000000..48ede62 --- /dev/null +++ b/patch-clamav101 @@ -0,0 +1,25 @@ +diff --git a/imap/cyr_virusscan.c b/imap/cyr_virusscan.c +index 863a858..b6c8980 100644 +--- a/imap/cyr_virusscan.c ++++ b/imap/cyr_virusscan.c +@@ -192,9 +192,19 @@ int clamav_scanfile(void *state, const char *fname, + struct clamav_state *st = (struct clamav_state *) state; + int r; + +- /* scan file */ ++#ifndef CL_SCAN_ARCHIVE /* clamav >= 0.101 */ ++ struct cl_scan_options options; ++ memset(&options, 0, sizeof(struct cl_scan_options)); ++ options.parse |= ~0; /* enable all parsers */ ++ options.general |= CL_SCAN_GENERAL_HEURISTICS; /* enable heuristic alert options */ ++ ++ r = cl_scanfile(fname, virname, NULL, st->av_engine, ++ &options); ++ ++#else + r = cl_scanfile(fname, virname, NULL, st->av_engine, + CL_SCAN_STDOPT); ++#endif + + switch (r) { + case CL_CLEAN: