Add patch to build with EL7 libcurl - re-enable on-access scanning

(bz#1820395)
This commit is contained in:
Orion Poplawski 2020-04-29 21:57:51 -06:00
parent 77db482a5b
commit f9c00c3977
2 changed files with 66 additions and 7 deletions

56
clamav-curl.patch Normal file
View File

@ -0,0 +1,56 @@
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([

View File

@ -2,13 +2,8 @@
%global _hardened_build 1
## Fedora Extras specific customization below...
# EL7's curl is too old
%if 0%{?fedora} || 0%{?rhel} >= 8
## Fedora specific customization below...
%bcond_without clamonacc
%else
%bcond_with clamonacc
%endif
%bcond_without tmpfiles
%bcond_with unrar
%ifnarch ppc64
@ -46,7 +41,7 @@
Summary: End-user tools for the Clam Antivirus scanner
Name: clamav
Version: 0.102.2
Release: 6%{?dist}
Release: 7%{?dist}
License: %{?with_unrar:proprietary}%{!?with_unrar:GPLv2}
URL: https://www.clamav.net/
%if %{with unrar}
@ -92,6 +87,8 @@ 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
BuildRequires: autoconf automake gettext-devel libtool libtool-ltdl-devel
BuildRequires: gcc-c++
@ -247,6 +244,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}
install -p -m0644 %SOURCE300 clamav-milter/
@ -594,6 +593,10 @@ fi
%changelog
* Wed Apr 29 2020 Orion Poplawski <orion@nwra.com> - 0.102.2-7
- Add patch to build with EL7 libcurl - re-enable on-access scanning
(bz#1820395)
* Tue Apr 21 2020 Björn Esser <besser82@fedoraproject.org> - 0.102.2-6
- Rebuild (json-c)