Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Jason Tibbitts
711bf49043 Handle the new ClamAV API
A new release of ClamAV was pushed out, even to stable releases.  This
update required a rebuild of any package using libclamav.  It also
changed the API, requiring a patch.
2019-01-14 23:56:08 -06:00
2 changed files with 32 additions and 1 deletions

View file

@ -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 <tibbs@math.uh.edu> - 3.0.5-9
- Add patch to handle the new ClamAV API and allow a rebuild.
* Thu Mar 01 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.5-8
- Bump client_timeout value in test suite.

25
patch-clamav101 Normal file
View file

@ -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: