Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: app-antivirus/clamav/files/, app-antivirus/clamav/
Date: Sat, 29 Dec 2018 15:13:26
Message-Id: 1546096251.ab57f107829ba7fc2cf04f6805912891886d4ff2.blueness@gentoo
1 commit: ab57f107829ba7fc2cf04f6805912891886d4ff2
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Sat Dec 29 15:10:51 2018 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Sat Dec 29 15:10:51 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=ab57f107
7
8 app-antivirus/clamav: sync with upstream
9
10 Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
11 Package-Manager: Portage-2.3.51, Repoman-2.3.11
12
13 app-antivirus/clamav/Manifest | 5 +-
14 ...mav-0.100.0.ebuild => clamav-0.100.1-r1.ebuild} | 10 +-
15 ...amav-0.99.4-r1.ebuild => clamav-0.100.2.ebuild} | 34 ++--
16 ...clamav-0.100.0.ebuild => clamav-0.101.0.ebuild} | 40 +++--
17 app-antivirus/clamav/files/clamav-0.99-zlib.patch | 22 ---
18 .../clamav/files/clamav-0.99.2-bytecode_api.patch | 50 ------
19 .../clamav/files/clamav-0.99.2-gcc-6.patch | 84 ----------
20 .../clamav-0.99.2-pcre2-compile-erroffset.patch | 12 --
21 .../clamav/files/clamav-0.99.2-tinfo.patch | 23 ---
22 ...lamav-0.99.3-VMSF_DELTA-fix-CVE-2012-6706.patch | 186 ---------------------
23 ...mav-0.99.3-fix-fd-leaks-in-cli_scanscript.patch | 132 ---------------
24 .../files/clamav-0.99.4-fix-newer-zlib.patch | 54 ------
25 .../clamav-0.99.4-pcre2-compile-erroffset.patch | 11 --
26 app-antivirus/clamav/files/freshclamd.service | 3 +
27 app-antivirus/clamav/metadata.xml | 1 +
28 15 files changed, 58 insertions(+), 609 deletions(-)
29
30 diff --git a/app-antivirus/clamav/Manifest b/app-antivirus/clamav/Manifest
31 index e2e5315..3b0a197 100644
32 --- a/app-antivirus/clamav/Manifest
33 +++ b/app-antivirus/clamav/Manifest
34 @@ -1,2 +1,3 @@
35 -DIST clamav-0.100.0.tar.gz 16036757 BLAKE2B c51edfb05726e16e2ff1ef1fee9f174af5a0d65396f847a4f6e1246d5844b92eb70896fc598d2c73719b1315ff3c41aca503823431e0918d52f56d29399dd796 SHA512 57e1da86a32fdfb66887c4aeed03008bc070ce3cb6b881db411332f2f2e640b73dca84d990f5886526b3d6bd0c2770c7dcce5b4e7cf48323824c362452593549
36 -DIST clamav-0.99.4.tar.gz 16083015 BLAKE2B 3c2e7d11ee05fe846f75c3fb6501b5fd809a2e58f8e69c82e493e32fcbc87ca0e5b5f7ab83a0d7e251a5dc8e84aed1475c87c1248b393fa04b6924a2ab32b9bf SHA512 778d5ef510d8d4bdfac5dc33d92469ed4283c414b3d42da6e1a0b13ed70e37755d5c837622dc336bc728ba1f8bf5485fc8a8d3a67a90e9aaa9e4dc71ece0691d
37 +DIST clamav-0.100.1.tar.gz 16154415 BLAKE2B df4ddde28b0b263765f4a571a407390b30aa6fe58d07e1b8fe427e70141219fb3d7c5addfbf30a350c6c08324dee1ec3dd80319306df7578ed87138c6513b99d SHA512 13a4e050e030ac3d1cc07b12bdd56c455e266e0b205a4c9bc9f18e53f6d8913a66eed2296abf857f395227ab0ed5c7bc90bc357bcb314dc9e18a9c6177dcc5b2
38 +DIST clamav-0.100.2.tar.gz 15926420 BLAKE2B 0a64a08b6cdad94f55852041df06b5517bcfa3bacb5871c694bf51692c4698ffd39f09c92fe2af167fcf2b27806a7175a9b649e6d6d5ffc65755509e3574d374 SHA512 70b51eafb11dc727188e7d4554b8095a9e0406e76b78778fede94f8a4c78146034478197217039384eb1fd15532e822cfa6b51707e431e9397ec21d5e393a60c
39 +DIST clamav-0.101.0.tar.gz 21686531 BLAKE2B ea3ae1e5b31d6b10600eac8f0ea93c9460f0e337de7a3f43345c26e0efb0b3f664d1f640b723795eac6491f959492202a249222b561917072811df86314ea9d8 SHA512 faf6186b51b332eca67684bfe72f473a910577093964338278656ab67c61d28f66f7f501f4db5e1bb37112d66ad4433d792c50af70aceefd5bcbc5dab7ac7aa0
40
41 diff --git a/app-antivirus/clamav/clamav-0.100.0.ebuild b/app-antivirus/clamav/clamav-0.100.1-r1.ebuild
42 similarity index 95%
43 copy from app-antivirus/clamav/clamav-0.100.0.ebuild
44 copy to app-antivirus/clamav/clamav-0.100.1-r1.ebuild
45 index f5b1d6f..1464637 100644
46 --- a/app-antivirus/clamav/clamav-0.100.0.ebuild
47 +++ b/app-antivirus/clamav/clamav-0.100.1-r1.ebuild
48 @@ -1,4 +1,4 @@
49 -# Copyright 1999-2018 Gentoo Foundation
50 +# Copyright 1999-2018 Gentoo Authors
51 # Distributed under the terms of the GNU General Public License v2
52
53 EAPI=6
54 @@ -11,7 +11,7 @@ SRC_URI="https://www.clamav.net/downloads/production/${P}.tar.gz"
55
56 LICENSE="GPL-2"
57 SLOT="0"
58 -KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
59 +KEYWORDS="~amd64 ~arm ~ppc ~x86"
60 IUSE="bzip2 doc clamdtop iconv ipv6 libressl milter metadata-analysis-api selinux static-libs system-libmspack test uclibc"
61
62 CDEPEND="bzip2? ( app-arch/bzip2 )
63 @@ -19,7 +19,6 @@ CDEPEND="bzip2? ( app-arch/bzip2 )
64 iconv? ( virtual/libiconv )
65 metadata-analysis-api? ( dev-libs/json-c:= )
66 milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )
67 - dev-libs/libtommath
68 >=sys-libs/zlib-1.2.2:=
69 !libressl? ( dev-libs/openssl:0= )
70 libressl? ( dev-libs/libressl:0= )
71 @@ -41,7 +40,7 @@ DOCS=( docs/clamdoc.pdf docs/phishsigs_howto.pdf docs/signatures.pdf )
72 HTML_DOCS=( docs/html )
73
74 PATCHES=(
75 - "${FILESDIR}/${P}_autotools.patch"
76 + "${FILESDIR}/clamav-0.100.0_autotools.patch"
77 )
78
79 pkg_setup() {
80 @@ -50,13 +49,13 @@ pkg_setup() {
81 }
82
83 src_prepare() {
84 - use elibc_musl && append-ldflags -lfts
85 default
86
87 eautoconf
88 }
89
90 src_configure() {
91 + use elibc_musl && append-ldflags -lfts
92 use ppc64 && append-flags -mminimal-toc
93 use uclibc && export ac_cv_type_error_t=yes
94
95 @@ -76,7 +75,6 @@ src_configure() {
96 --disable-zlib-vcheck \
97 --enable-id-check \
98 --with-dbdir="${EPREFIX}"/var/lib/clamav \
99 - --with-system-tommath \
100 --with-zlib="${EPREFIX}"/usr \
101 --disable-llvm
102 }
103
104 diff --git a/app-antivirus/clamav/clamav-0.99.4-r1.ebuild b/app-antivirus/clamav/clamav-0.100.2.ebuild
105 similarity index 85%
106 rename from app-antivirus/clamav/clamav-0.99.4-r1.ebuild
107 rename to app-antivirus/clamav/clamav-0.100.2.ebuild
108 index 489f8fe..fd98bc0 100644
109 --- a/app-antivirus/clamav/clamav-0.99.4-r1.ebuild
110 +++ b/app-antivirus/clamav/clamav-0.100.2.ebuild
111 @@ -1,4 +1,4 @@
112 -# Copyright 1999-2018 Gentoo Foundation
113 +# Copyright 1999-2018 Gentoo Authors
114 # Distributed under the terms of the GNU General Public License v2
115
116 EAPI=6
117 @@ -11,20 +11,21 @@ SRC_URI="https://www.clamav.net/downloads/production/${P}.tar.gz"
118
119 LICENSE="GPL-2"
120 SLOT="0"
121 -KEYWORDS="alpha amd64 ~arm ~arm64 hppa ia64 ~ppc ppc64 ~sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
122 -IUSE="bzip2 clamdtop iconv ipv6 libressl milter metadata-analysis-api selinux static-libs test uclibc"
123 +KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
124 +IUSE="bzip2 doc clamdtop iconv ipv6 libressl milter metadata-analysis-api selinux static-libs test uclibc xml"
125
126 CDEPEND="bzip2? ( app-arch/bzip2 )
127 clamdtop? ( sys-libs/ncurses:0 )
128 iconv? ( virtual/libiconv )
129 metadata-analysis-api? ( dev-libs/json-c:= )
130 milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )
131 - dev-libs/libtommath
132 >=sys-libs/zlib-1.2.2:=
133 !libressl? ( dev-libs/openssl:0= )
134 libressl? ( dev-libs/libressl:0= )
135 sys-devel/libtool
136 || ( dev-libs/libpcre2 >dev-libs/libpcre-6 )
137 + dev-libs/libmspack
138 + xml? ( dev-libs/libxml2 )
139 elibc_musl? ( sys-libs/fts-standalone )
140 !!<app-antivirus/clamav-0.99"
141 # hard block clamav < 0.99 due to linking problems Bug #567680
142 @@ -36,10 +37,11 @@ DEPEND="${CDEPEND}
143 RDEPEND="${CDEPEND}
144 selinux? ( sec-policy/selinux-clamav )"
145
146 -DOCS=( AUTHORS BUGS ChangeLog FAQ INSTALL NEWS README UPGRADE )
147 +DOCS=( docs/clamdoc.pdf docs/phishsigs_howto.pdf docs/signatures.pdf )
148 +HTML_DOCS=( docs/html )
149 +
150 PATCHES=(
151 - "${FILESDIR}"/${PN}-0.99.4-fix-newer-zlib.patch
152 - "${FILESDIR}/${P}-pcre2-compile-erroffset.patch"
153 + "${FILESDIR}/clamav-0.100.0_autotools.patch"
154 )
155
156 pkg_setup() {
157 @@ -48,16 +50,22 @@ pkg_setup() {
158 }
159
160 src_prepare() {
161 - use elibc_musl && append-ldflags -lfts
162 default
163
164 eautoconf
165 }
166
167 src_configure() {
168 + use elibc_musl && append-ldflags -lfts
169 use ppc64 && append-flags -mminimal-toc
170 use uclibc && export ac_cv_type_error_t=yes
171
172 + # according to configure help it should be
173 + # $(use_enable xml)
174 + # but that does not work
175 + # do not add this, since --disable-xml seems to override
176 + # --without-xml
177 +
178 econf \
179 $(use_enable bzip2) \
180 $(use_enable clamdtop) \
181 @@ -65,15 +73,16 @@ src_configure() {
182 $(use_enable milter) \
183 $(use_enable static-libs static) \
184 $(use_enable test check) \
185 + $(use_with xml) \
186 $(use_with iconv) \
187 $(use_with metadata-analysis-api libjson /usr) \
188 + --with-system-libmspack \
189 --cache-file="${S}"/config.cache \
190 --disable-experimental \
191 --disable-gcc-vcheck \
192 --disable-zlib-vcheck \
193 --enable-id-check \
194 --with-dbdir="${EPREFIX}"/var/lib/clamav \
195 - --with-system-tommath \
196 --with-zlib="${EPREFIX}"/usr \
197 --disable-llvm
198 }
199 @@ -120,7 +129,7 @@ src_install() {
200 if use milter ; then
201 # MilterSocket one to include ' /' because there is a 2nd line for
202 # inet: which we want to leave
203 - dodoc "${FILESDIR}"/clamav-milter.README.gentoo
204 + ##dodoc "${FILESDIR}"/clamav-milter.README.gentoo
205 sed -i -e "s:^\(Example\):\# \1:" \
206 -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamav-milter.pid:" \
207 -e "s+^\#\(ClamdSocket\) .*+\1 unix:${EPREFIX}/var/run/clamav/clamd.sock+" \
208 @@ -137,6 +146,11 @@ src_install() {
209 systemd_newunit "${FILESDIR}/clamav-milter.service-r1" clamav-milter.service
210 fi
211
212 + if use doc; then
213 + einstalldocs
214 + doman docs/man/*.[1-8]
215 + fi
216 +
217 for i in clamd freshclam clamav-milter
218 do
219 [[ -f "${D}"/etc/"${i}".conf.sample ]] && mv "${D}"/etc/"${i}".conf{.sample,}
220
221 diff --git a/app-antivirus/clamav/clamav-0.100.0.ebuild b/app-antivirus/clamav/clamav-0.101.0.ebuild
222 similarity index 88%
223 rename from app-antivirus/clamav/clamav-0.100.0.ebuild
224 rename to app-antivirus/clamav/clamav-0.101.0.ebuild
225 index f5b1d6f..5f65942 100644
226 --- a/app-antivirus/clamav/clamav-0.100.0.ebuild
227 +++ b/app-antivirus/clamav/clamav-0.101.0.ebuild
228 @@ -1,4 +1,4 @@
229 -# Copyright 1999-2018 Gentoo Foundation
230 +# Copyright 1999-2018 Gentoo Authors
231 # Distributed under the terms of the GNU General Public License v2
232
233 EAPI=6
234 @@ -11,21 +11,21 @@ SRC_URI="https://www.clamav.net/downloads/production/${P}.tar.gz"
235
236 LICENSE="GPL-2"
237 SLOT="0"
238 -KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
239 -IUSE="bzip2 doc clamdtop iconv ipv6 libressl milter metadata-analysis-api selinux static-libs system-libmspack test uclibc"
240 +KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
241 +IUSE="bzip2 doc clamdtop iconv ipv6 libressl milter metadata-analysis-api selinux static-libs test uclibc xml"
242
243 CDEPEND="bzip2? ( app-arch/bzip2 )
244 clamdtop? ( sys-libs/ncurses:0 )
245 iconv? ( virtual/libiconv )
246 metadata-analysis-api? ( dev-libs/json-c:= )
247 milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )
248 - dev-libs/libtommath
249 >=sys-libs/zlib-1.2.2:=
250 !libressl? ( dev-libs/openssl:0= )
251 libressl? ( dev-libs/libressl:0= )
252 sys-devel/libtool
253 || ( dev-libs/libpcre2 >dev-libs/libpcre-6 )
254 - system-libmspack? ( dev-libs/libmspack )
255 + dev-libs/libmspack
256 + xml? ( dev-libs/libxml2 )
257 elibc_musl? ( sys-libs/fts-standalone )
258 !!<app-antivirus/clamav-0.99"
259 # hard block clamav < 0.99 due to linking problems Bug #567680
260 @@ -37,29 +37,35 @@ DEPEND="${CDEPEND}
261 RDEPEND="${CDEPEND}
262 selinux? ( sec-policy/selinux-clamav )"
263
264 -DOCS=( docs/clamdoc.pdf docs/phishsigs_howto.pdf docs/signatures.pdf )
265 +DOCS=( docs/UserManual.md docs/UserManual )
266 HTML_DOCS=( docs/html )
267
268 -PATCHES=(
269 - "${FILESDIR}/${P}_autotools.patch"
270 -)
271 +#PATCHES=(
272 +# "${FILESDIR}/clamav-0.100.0_autotools.patch"
273 +#)
274
275 pkg_setup() {
276 enewgroup clamav
277 enewuser clamav -1 -1 /dev/null clamav
278 }
279
280 -src_prepare() {
281 - use elibc_musl && append-ldflags -lfts
282 - default
283 -
284 - eautoconf
285 -}
286 +#src_prepare() {
287 +# default
288 +#
289 +# eautoconf
290 +#}
291
292 src_configure() {
293 + use elibc_musl && append-ldflags -lfts
294 use ppc64 && append-flags -mminimal-toc
295 use uclibc && export ac_cv_type_error_t=yes
296
297 + # according to configure help it should be
298 + # $(use_enable xml)
299 + # but that does not work
300 + # do not add this, since --disable-xml seems to override
301 + # --without-xml
302 +
303 econf \
304 $(use_enable bzip2) \
305 $(use_enable clamdtop) \
306 @@ -67,16 +73,16 @@ src_configure() {
307 $(use_enable milter) \
308 $(use_enable static-libs static) \
309 $(use_enable test check) \
310 + $(use_with xml) \
311 $(use_with iconv) \
312 $(use_with metadata-analysis-api libjson /usr) \
313 - $(use_with system-libmspack) \
314 + --with-system-libmspack \
315 --cache-file="${S}"/config.cache \
316 --disable-experimental \
317 --disable-gcc-vcheck \
318 --disable-zlib-vcheck \
319 --enable-id-check \
320 --with-dbdir="${EPREFIX}"/var/lib/clamav \
321 - --with-system-tommath \
322 --with-zlib="${EPREFIX}"/usr \
323 --disable-llvm
324 }
325
326 diff --git a/app-antivirus/clamav/files/clamav-0.99-zlib.patch b/app-antivirus/clamav/files/clamav-0.99-zlib.patch
327 deleted file mode 100644
328 index 8d1f4e6..0000000
329 --- a/app-antivirus/clamav/files/clamav-0.99-zlib.patch
330 +++ /dev/null
331 @@ -1,22 +0,0 @@
332 -commit f0bcd186190fe6e67b3f0eaaceb7a99aa6a98865
333 -Author: Steven Morgan <stevmorg@×××××.com>
334 -Date: Thu Jan 5 12:30:35 2017 -0500
335 -
336 - bb111711 - fix zlib version check - patch by Daniel J. Luke.
337 -
338 -diff --git a/m4/reorganization/libs/libz.m4 b/m4/reorganization/libs/libz.m4
339 -index b5c7414..f7b67ca 100644
340 ---- a/m4/reorganization/libs/libz.m4
341 -+++ b/m4/reorganization/libs/libz.m4
342 -@@ -29,9 +29,9 @@ then
343 - AC_MSG_ERROR([Please install zlib and zlib-devel packages])
344 - else
345 -
346 -- vuln=`grep "ZLIB_VERSION \"1.2.0" $ZLIB_HOME/include/zlib.h`
347 -+ vuln=`grep "ZLIB_VERSION \"1.2.0\"" $ZLIB_HOME/include/zlib.h`
348 - if test -z "$vuln"; then
349 -- vuln=`grep "ZLIB_VERSION \"1.2.1" $ZLIB_HOME/include/zlib.h`
350 -+ vuln=`grep "ZLIB_VERSION \"1.2.1\"" $ZLIB_HOME/include/zlib.h`
351 - fi
352 -
353 - if test -n "$vuln"; then
354
355 diff --git a/app-antivirus/clamav/files/clamav-0.99.2-bytecode_api.patch b/app-antivirus/clamav/files/clamav-0.99.2-bytecode_api.patch
356 deleted file mode 100644
357 index d6cd526..0000000
358 --- a/app-antivirus/clamav/files/clamav-0.99.2-bytecode_api.patch
359 +++ /dev/null
360 @@ -1,50 +0,0 @@
361 -Description: fix compatibility with zlib 1.2.9 and newer
362 -Author: Marc Deslauriers <marc.deslauriers@×××××××××.com>
363 -Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/clamav/+bug/1692073
364 -
365 ---- a/libclamav/bytecode_api.c 2017-08-08 15:20:06.651685637 -0400
366 -+++ b/libclamav/bytecode_api.c 2017-08-15 15:45:14.645714766 -0400
367 -@@ -811,8 +811,20 @@ int32_t cli_bcapi_inflate_init(struct cl
368 - cli_dbgmsg("bytecode api: inflate_init: invalid buffers!\n");
369 - return -1;
370 - }
371 -- memset(&stream, 0, sizeof(stream));
372 -- ret = inflateInit2(&stream, windowBits);
373 -+
374 -+ b = cli_realloc(ctx->inflates, sizeof(*ctx->inflates)*n);
375 -+ if (!b) {
376 -+ return -1;
377 -+ }
378 -+ ctx->inflates = b;
379 -+ ctx->ninflates = n;
380 -+ b = &b[n-1];
381 -+
382 -+ b->from = from;
383 -+ b->to = to;
384 -+ b->needSync = 0;
385 -+ memset(&b->stream, 0, sizeof(stream));
386 -+ ret = inflateInit2(&b->stream, windowBits);
387 - switch (ret) {
388 - case Z_MEM_ERROR:
389 - cli_dbgmsg("bytecode api: inflateInit2: out of memory!\n");
390 -@@ -829,20 +841,6 @@ int32_t cli_bcapi_inflate_init(struct cl
391 - cli_dbgmsg("bytecode api: inflateInit2: unknown error %d\n", ret);
392 - return -1;
393 - }
394 --
395 -- b = cli_realloc(ctx->inflates, sizeof(*ctx->inflates)*n);
396 -- if (!b) {
397 -- inflateEnd(&stream);
398 -- return -1;
399 -- }
400 -- ctx->inflates = b;
401 -- ctx->ninflates = n;
402 -- b = &b[n-1];
403 --
404 -- b->from = from;
405 -- b->to = to;
406 -- b->needSync = 0;
407 -- memcpy(&b->stream, &stream, sizeof(stream));
408 - return n-1;
409 - }
410 -
411
412 diff --git a/app-antivirus/clamav/files/clamav-0.99.2-gcc-6.patch b/app-antivirus/clamav/files/clamav-0.99.2-gcc-6.patch
413 deleted file mode 100644
414 index 2031edb..0000000
415 --- a/app-antivirus/clamav/files/clamav-0.99.2-gcc-6.patch
416 +++ /dev/null
417 @@ -1,84 +0,0 @@
418 -diff --git a/libclamav/c++/llvm/include/llvm/ADT/StringMap.h b/libclamav/c++/llvm/include/llvm/ADT/StringMap.h
419 -index 59ff6aa..1325394 100644
420 ---- a/libclamav/c++/llvm/include/llvm/ADT/StringMap.h
421 -+++ b/libclamav/c++/llvm/include/llvm/ADT/StringMap.h
422 -@@ -169,3 +169,3 @@ public:
423 - KeyLength+1;
424 -- unsigned Alignment = alignof<StringMapEntry>();
425 -+ unsigned Alignment = alignOf<StringMapEntry>();
426 -
427 -diff --git a/libclamav/c++/llvm/include/llvm/CodeGen/SlotIndexes.h b/libclamav/c++/llvm/include/llvm/CodeGen/SlotIndexes.h
428 -index 88044c7..86b0f40 100644
429 ---- a/libclamav/c++/llvm/include/llvm/CodeGen/SlotIndexes.h
430 -+++ b/libclamav/c++/llvm/include/llvm/CodeGen/SlotIndexes.h
431 -@@ -417,3 +417,3 @@ namespace llvm {
432 - ileAllocator.Allocate(sizeof(IndexListEntry),
433 -- alignof<IndexListEntry>()));
434 -+ alignOf<IndexListEntry>()));
435 -
436 -diff --git a/libclamav/c++/llvm/include/llvm/Support/AlignOf.h b/libclamav/c++/llvm/include/llvm/Support/AlignOf.h
437 -index 6a7a1a6..979e597 100644
438 ---- a/libclamav/c++/llvm/include/llvm/Support/AlignOf.h
439 -+++ b/libclamav/c++/llvm/include/llvm/Support/AlignOf.h
440 -@@ -51,8 +51,8 @@ struct AlignOf {
441 -
442 --/// alignof - A templated function that returns the mininum alignment of
443 -+/// alignOf - A templated function that returns the mininum alignment of
444 - /// of a type. This provides no extra functionality beyond the AlignOf
445 - /// class besides some cosmetic cleanliness. Example usage:
446 --/// alignof<int>() returns the alignment of an int.
447 -+/// alignOf<int>() returns the alignment of an int.
448 - template <typename T>
449 --static inline unsigned alignof() { return AlignOf<T>::Alignment; }
450 -+static inline unsigned alignOf() { return AlignOf<T>::Alignment; }
451 -
452 -diff --git a/libclamav/c++/llvm/include/llvm/Support/Allocator.h b/libclamav/c++/llvm/include/llvm/Support/Allocator.h
453 -index 4a7251f..17caf5e 100644
454 ---- a/libclamav/c++/llvm/include/llvm/Support/Allocator.h
455 -+++ b/libclamav/c++/llvm/include/llvm/Support/Allocator.h
456 -@@ -203,3 +203,3 @@ public:
457 - for (char *Ptr = (char*)(Slab+1); Ptr < End; Ptr += sizeof(T)) {
458 -- Ptr = Allocator.AlignPtr(Ptr, alignof<T>());
459 -+ Ptr = Allocator.AlignPtr(Ptr, alignOf<T>());
460 - if (Ptr + sizeof(T) <= End)
461 -diff --git a/libclamav/c++/llvm/lib/Analysis/ScalarEvolution.cpp b/libclamav/c++/llvm/lib/Analysis/ScalarEvolution.cpp
462 -index b892d85..dc72346 100644
463 ---- a/libclamav/c++/llvm/lib/Analysis/ScalarEvolution.cpp
464 -+++ b/libclamav/c++/llvm/lib/Analysis/ScalarEvolution.cpp
465 -@@ -495,3 +495,3 @@ void SCEVUnknown::print(raw_ostream &OS) const {
466 - if (isAlignOf(AllocTy)) {
467 -- OS << "alignof(" << *AllocTy << ")";
468 -+ OS << "alignOf(" << *AllocTy << ")";
469 - return;
470 -diff --git a/libclamav/c++/llvm/lib/Target/X86/X86CodeEmitter.cpp b/libclamav/c++/llvm/lib/Target/X86/X86CodeEmitter.cpp
471 -index 824021c..757ca50 100644
472 ---- a/libclamav/c++/llvm/lib/Target/X86/X86CodeEmitter.cpp
473 -+++ b/libclamav/c++/llvm/lib/Target/X86/X86CodeEmitter.cpp
474 -@@ -569,3 +569,3 @@ void Emitter<CodeEmitter>::emitMemModRMByte(const MachineInstr &MI,
475 - // Calculate what the SS field value should be...
476 -- static const unsigned SSTable[] = { ~0, 0, 1, ~0, 2, ~0, ~0, ~0, 3 };
477 -+ static const unsigned SSTable[] = { ~0u, 0u, 1u, ~0u, 2u, ~0u, ~0u, ~0u, 3u };
478 - unsigned SS = SSTable[Scale.getImm()];
479 -diff --git a/libclamav/c++/llvm/lib/Target/X86/X86MCCodeEmitter.cpp b/libclamav/c++/llvm/lib/Target/X86/X86MCCodeEmitter.cpp
480 -index 9564fe0..b2b7986 100644
481 ---- a/libclamav/c++/llvm/lib/Target/X86/X86MCCodeEmitter.cpp
482 -+++ b/libclamav/c++/llvm/lib/Target/X86/X86MCCodeEmitter.cpp
483 -@@ -332,3 +332,3 @@ void X86MCCodeEmitter::EmitMemModRMByte(const MCInst &MI, unsigned Op,
484 - // Calculate what the SS field value should be...
485 -- static const unsigned SSTable[] = { ~0, 0, 1, ~0, 2, ~0, ~0, ~0, 3 };
486 -+ static const unsigned SSTable[] = { ~0u, 0u, 1u, ~0u, 2u, ~0u, ~0u, ~0u, 3u };
487 - unsigned SS = SSTable[Scale.getImm()];
488 -diff --git a/libclamav/mpool.c b/libclamav/mpool.c
489 -index cd38e15..b5e537d 100644
490 ---- a/libclamav/mpool.c
491 -+++ b/libclamav/mpool.c
492 -@@ -417,3 +417,3 @@ static size_t from_bits(unsigned int bits) {
493 -
494 --static inline unsigned int alignof(size_t size)
495 -+static inline unsigned int alignOf(size_t size)
496 - {
497 -@@ -609,3 +609,3 @@ static void* allocate_aligned(struct MPMAP *mpm, size_t size, unsigned align, co
498 - void *mpool_malloc(struct MP *mp, size_t size) {
499 -- size_t align = alignof(size);
500 -+ size_t align = alignOf(size);
501 - size_t i, needed = align_increase(size+FRAG_OVERHEAD, align);
502
503 diff --git a/app-antivirus/clamav/files/clamav-0.99.2-pcre2-compile-erroffset.patch b/app-antivirus/clamav/files/clamav-0.99.2-pcre2-compile-erroffset.patch
504 deleted file mode 100644
505 index 1ee5517..0000000
506 --- a/app-antivirus/clamav/files/clamav-0.99.2-pcre2-compile-erroffset.patch
507 +++ /dev/null
508 @@ -1,12 +0,0 @@
509 ---- clamav-0.99.2/libclamav/regex_pcre.c~ 2017-11-28 14:40:56.484208243 +0100
510 -+++ clamav-0.99.2/libclamav/regex_pcre.c 2017-11-28 14:41:07.301207800 +0100
511 -@@ -112,7 +112,8 @@ int cli_pcre_addoptions(struct cli_pcre_
512 - #if USING_PCRE2
513 - int cli_pcre_compile(struct cli_pcre_data *pd, long long unsigned match_limit, long long unsigned match_limit_recursion, unsigned int options, int opt_override)
514 - {
515 -- int errornum, erroffset;
516 -+ int errornum;
517 -+ size_t erroffset;
518 - pcre2_general_context *gctx;
519 - pcre2_compile_context *cctx;
520 -
521
522 diff --git a/app-antivirus/clamav/files/clamav-0.99.2-tinfo.patch b/app-antivirus/clamav/files/clamav-0.99.2-tinfo.patch
523 deleted file mode 100644
524 index 4593d16..0000000
525 --- a/app-antivirus/clamav/files/clamav-0.99.2-tinfo.patch
526 +++ /dev/null
527 @@ -1,23 +0,0 @@
528 ---- a/m4/reorganization/clamdtop.m4
529 -+++ b/m4/reorganization/clamdtop.m4
530 -@@ -4,12 +4,20 @@
531 -
532 - if test "$enable_clamdtop" != "no"; then
533 -
534 -+PKG_CHECK_MODULES([CURSES],[ncurses],
535 -+ [HAVE_LIBNCURSES=yes; CURSES_INCLUDE="<ncurses.h>"],
536 -+ [HAVE_LIBNCURSES=no],
537 -+)
538 -+
539 -+if test "X$HAVE_LIBNCURSES" != "Xyes"; then
540 -+ HAVE_LIBNCURSES=
541 - AC_LIB_FIND([ncurses], [ncurses/ncurses.h],
542 - AC_LANG_PROGRAM([#include <ncurses/ncurses.h>],
543 - [initscr(); KEY_RESIZE;]),
544 - [CURSES_CPPFLAGS="$INCNCURSES"; CURSES_LIBS="$LTLIBNCURSES";
545 - CURSES_INCLUDE="<ncurses/ncurses.h>"],
546 - [])
547 -+fi
548 -
549 - if test "X$HAVE_LIBNCURSES" != "Xyes"; then
550 - HAVE_LIBNCURSES=
551
552 diff --git a/app-antivirus/clamav/files/clamav-0.99.3-VMSF_DELTA-fix-CVE-2012-6706.patch b/app-antivirus/clamav/files/clamav-0.99.3-VMSF_DELTA-fix-CVE-2012-6706.patch
553 deleted file mode 100644
554 index 90facf6..0000000
555 --- a/app-antivirus/clamav/files/clamav-0.99.3-VMSF_DELTA-fix-CVE-2012-6706.patch
556 +++ /dev/null
557 @@ -1,186 +0,0 @@
558 -Apply proposed changes to fix RAR VMSF_DELTA Filter Signedness error (CVE-2012-6706)
559 -
560 -Cherry picked from commit a7d8447bd9a4d5ae1fa970c1849c8caeb5f1a805 [Link 1] and
561 -d4699442bce76574573dc564e7f2177d679b88bd [Link 2].
562 -
563 -Link 1: https://github.com/Cisco-Talos/clamav-devel/commit/a7d8447bd9a4d5ae1fa970c1849c8caeb5f1a805
564 -Link 2: https://github.com/Cisco-Talos/clamav-devel/commit/d4699442bce76574573dc564e7f2177d679b88bd
565 -
566 ---- a/libclamunrar/unrarvm.c
567 -+++ b/libclamunrar/unrarvm.c
568 -@@ -213,17 +213,20 @@ void rarvm_addbits(rarvm_input_t *rarvm_input, int bits)
569 -
570 - unsigned int rarvm_getbits(rarvm_input_t *rarvm_input)
571 - {
572 -- unsigned int bit_field;
573 -+ unsigned int bit_field = 0;
574 -
575 -- if (rarvm_input->in_addr+2 < rarvm_input->buf_size) {
576 -+ if (rarvm_input->in_addr < rarvm_input->buf_size) {
577 - bit_field = (unsigned int) rarvm_input->in_buf[rarvm_input->in_addr] << 16;
578 -- bit_field |= (unsigned int) rarvm_input->in_buf[rarvm_input->in_addr+1] << 8;
579 -- bit_field |= (unsigned int) rarvm_input->in_buf[rarvm_input->in_addr+2];
580 -- bit_field >>= (8-rarvm_input->in_bit);
581 --
582 -- return (bit_field & 0xffff);
583 -+ if (rarvm_input->in_addr+1 < rarvm_input->buf_size) {
584 -+ bit_field |= (unsigned int) rarvm_input->in_buf[rarvm_input->in_addr+1] << 8;
585 -+ if (rarvm_input->in_addr+2 < rarvm_input->buf_size) {
586 -+ bit_field |= (unsigned int) rarvm_input->in_buf[rarvm_input->in_addr+2];
587 -+ }
588 -+ }
589 - }
590 -- return 0;
591 -+ bit_field >>= (8-rarvm_input->in_bit);
592 -+
593 -+ return (bit_field & 0xffff);
594 - }
595 -
596 - unsigned int rarvm_read_data(rarvm_input_t *rarvm_input)
597 -@@ -311,10 +314,10 @@ static unsigned int *rarvm_get_operand(rarvm_data_t *rarvm_data,
598 - }
599 - }
600 -
601 --static unsigned int filter_itanium_getbits(unsigned char *data, int bit_pos, int bit_count)
602 -+static unsigned int filter_itanium_getbits(unsigned char *data, unsigned int bit_pos, unsigned int bit_count)
603 - {
604 -- int in_addr=bit_pos/8;
605 -- int in_bit=bit_pos&7;
606 -+ unsigned int in_addr=bit_pos/8;
607 -+ unsigned int in_bit=bit_pos&7;
608 - unsigned int bit_field=(unsigned int)data[in_addr++];
609 - bit_field|=(unsigned int)data[in_addr++] << 8;
610 - bit_field|=(unsigned int)data[in_addr++] << 16;
611 -@@ -323,10 +326,10 @@ static unsigned int filter_itanium_getbits(unsigned char *data, int bit_pos, int
612 - return(bit_field & (0xffffffff>>(32-bit_count)));
613 - }
614 -
615 --static void filter_itanium_setbits(unsigned char *data, unsigned int bit_field, int bit_pos, int bit_count)
616 -+static void filter_itanium_setbits(unsigned char *data, unsigned int bit_field, unsigned int bit_pos, unsigned int bit_count)
617 - {
618 -- int i, in_addr=bit_pos/8;
619 -- int in_bit=bit_pos&7;
620 -+ unsigned int i, in_addr=bit_pos/8;
621 -+ unsigned int in_bit=bit_pos&7;
622 - unsigned int and_mask=0xffffffff>>(32-bit_count);
623 - and_mask=~(and_mask<<in_bit);
624 -
625 -@@ -343,11 +346,12 @@ static void filter_itanium_setbits(unsigned char *data, unsigned int bit_field,
626 - static void execute_standard_filter(rarvm_data_t *rarvm_data, rarvm_standard_filters_t filter_type)
627 - {
628 - unsigned char *data, cmp_byte2, cur_byte, *src_data, *dest_data;
629 -- int i, j, data_size, channels, src_pos, dest_pos, border, width, PosR;
630 -- int op_type, cur_channel, byte_count, start_pos, pa, pb, pc;
631 -+ unsigned int i, j, data_size, channels, src_pos, dest_pos, border, width, PosR;
632 -+ unsigned int op_type, cur_channel, byte_count, start_pos;
633 -+ int pa, pb, pc;
634 - unsigned int file_offset, cur_pos, predicted;
635 -- int32_t offset, addr;
636 -- const int file_size=0x1000000;
637 -+ uint32_t offset, addr;
638 -+ const unsigned int file_size=0x1000000;
639 -
640 - switch(filter_type) {
641 - case VMSF_E8:
642 -@@ -356,7 +360,7 @@ static void execute_standard_filter(rarvm_data_t *rarvm_data, rarvm_standard_fil
643 - data_size = rarvm_data->R[4];
644 - file_offset = rarvm_data->R[6];
645 -
646 -- if (((unsigned int)data_size >= VM_GLOBALMEMADDR) || (data_size < 4)) {
647 -+ if ((data_size > VM_GLOBALMEMADDR) || (data_size < 4)) {
648 - break;
649 - }
650 -
651 -@@ -367,12 +371,14 @@ static void execute_standard_filter(rarvm_data_t *rarvm_data, rarvm_standard_fil
652 - if (cur_byte==0xe8 || cur_byte==cmp_byte2) {
653 - offset = cur_pos+file_offset;
654 - addr = GET_VALUE(FALSE, data);
655 -- if (addr < 0) {
656 -- if (addr+offset >=0 ) {
657 -+ // We check 0x80000000 bit instead of '< 0' comparison
658 -+ // not assuming int32 presence or uint size and endianness.
659 -+ if ((addr & 0x80000000)!=0) { // addr<0
660 -+ if (((addr+offset) & 0x80000000)==0) { // addr+offset>=0
661 - SET_VALUE(FALSE, data, addr+file_size);
662 - }
663 - } else {
664 -- if (addr<file_size) {
665 -+ if (((addr-file_size) & 0x80000000)!=0) { // addr<file_size
666 - SET_VALUE(FALSE, data, addr-offset);
667 - }
668 - }
669 -@@ -386,7 +392,7 @@ static void execute_standard_filter(rarvm_data_t *rarvm_data, rarvm_standard_fil
670 - data_size = rarvm_data->R[4];
671 - file_offset = rarvm_data->R[6];
672 -
673 -- if (((unsigned int)data_size >= VM_GLOBALMEMADDR) || (data_size < 21)) {
674 -+ if ((data_size > VM_GLOBALMEMADDR) || (data_size < 21)) {
675 - break;
676 - }
677 -
678 -@@ -429,7 +435,7 @@ static void execute_standard_filter(rarvm_data_t *rarvm_data, rarvm_standard_fil
679 - border = data_size*2;
680 -
681 - SET_VALUE(FALSE, &rarvm_data->mem[VM_GLOBALMEMADDR+0x20], data_size);
682 -- if ((unsigned int)data_size >= VM_GLOBALMEMADDR/2) {
683 -+ if (data_size > VM_GLOBALMEMADDR/2 || channels > 1024 || channels == 0) {
684 - break;
685 - }
686 - for (cur_channel=0 ; cur_channel < channels ; cur_channel++) {
687 -@@ -440,7 +446,7 @@ static void execute_standard_filter(rarvm_data_t *rarvm_data, rarvm_standard_fil
688 - }
689 - break;
690 - case VMSF_RGB: {
691 -- const int channels=3;
692 -+ const unsigned int channels=3;
693 - data_size = rarvm_data->R[4];
694 - width = rarvm_data->R[0] - 3;
695 - PosR = rarvm_data->R[1];
696 -@@ -448,15 +454,14 @@ static void execute_standard_filter(rarvm_data_t *rarvm_data, rarvm_standard_fil
697 - dest_data = src_data + data_size;
698 -
699 - SET_VALUE(FALSE, &rarvm_data->mem[VM_GLOBALMEMADDR+0x20], data_size);
700 -- if ((unsigned int)data_size >= VM_GLOBALMEMADDR/2) {
701 -+ if (data_size > VM_GLOBALMEMADDR/2 || data_size < 3 || width > data_size || PosR > 2) {
702 - break;
703 - }
704 - for (cur_channel=0 ; cur_channel < channels; cur_channel++) {
705 - unsigned int prev_byte = 0;
706 - for (i=cur_channel ; i<data_size ; i+=channels) {
707 -- int upper_pos=i-width;
708 -- if (upper_pos >= 3) {
709 -- unsigned char *upper_data = dest_data+upper_pos;
710 -+ if (i >= width+3) {
711 -+ unsigned char *upper_data = dest_data+i-width;
712 - unsigned int upper_byte = *upper_data;
713 - unsigned int upper_left_byte = *(upper_data-3);
714 - predicted = prev_byte+upper_byte-upper_left_byte;
715 -@@ -486,13 +491,14 @@ static void execute_standard_filter(rarvm_data_t *rarvm_data, rarvm_standard_fil
716 - break;
717 - }
718 - case VMSF_AUDIO: {
719 -- int channels=rarvm_data->R[0];
720 -+ unsigned int channels=rarvm_data->R[0];
721 - data_size = rarvm_data->R[4];
722 - src_data = rarvm_data->mem;
723 - dest_data = src_data + data_size;
724 -
725 - SET_VALUE(FALSE, &rarvm_data->mem[VM_GLOBALMEMADDR+0x20], data_size);
726 -- if ((unsigned int)data_size >= VM_GLOBALMEMADDR/2) {
727 -+ // In fact, audio channels never exceed 4.
728 -+ if (data_size > VM_GLOBALMEMADDR/2 || channels > 128 || channels == 0) {
729 - break;
730 - }
731 - for (cur_channel=0 ; cur_channel < channels ; cur_channel++) {
732 -@@ -553,7 +559,7 @@ static void execute_standard_filter(rarvm_data_t *rarvm_data, rarvm_standard_fil
733 - data_size = rarvm_data->R[4];
734 - src_pos = 0;
735 - dest_pos = data_size;
736 -- if ((unsigned int)data_size >= VM_GLOBALMEMADDR/2) {
737 -+ if (data_size > VM_GLOBALMEMADDR/2) {
738 - break;
739 - }
740 - while (src_pos < data_size) {
741 ---
742 -2.16.2
743 -
744
745 diff --git a/app-antivirus/clamav/files/clamav-0.99.3-fix-fd-leaks-in-cli_scanscript.patch b/app-antivirus/clamav/files/clamav-0.99.3-fix-fd-leaks-in-cli_scanscript.patch
746 deleted file mode 100644
747 index a457a71..0000000
748 --- a/app-antivirus/clamav/files/clamav-0.99.3-fix-fd-leaks-in-cli_scanscript.patch
749 +++ /dev/null
750 @@ -1,132 +0,0 @@
751 -Author: Manuel Mausz <manuel-clamav@×××××.at>
752 -
753 -http://lists.clamav.net/pipermail/clamav-users/2018-January/005687.html
754 -
755 ---- clamav-0.99.3/libclamav/scanners.c.orig 2018-01-26 14:35:23.299386703 +0100
756 -+++ clamav-0.99.3/libclamav/scanners.c 2018-01-26 14:47:44.422451335 +0100
757 -@@ -1342,39 +1342,35 @@
758 - return CL_CLEAN;
759 - }
760 -
761 -- /* dump to disk only if explicitly asked to
762 -- * or if necessary to check relative offsets,
763 -- * otherwise we can process just in-memory */
764 -- if(ctx->engine->keeptmp || (troot && troot->ac_reloff_num > 0)) {
765 -- if((ret = cli_gentempfd(ctx->engine->tmpdir, &tmpname, &ofd))) {
766 -- cli_dbgmsg("cli_scanscript: Can't generate temporary file/descriptor\n");
767 -- return ret;
768 -- }
769 -- if (ctx->engine->keeptmp)
770 -- cli_dbgmsg("cli_scanscript: saving normalized file to %s\n", tmpname);
771 -- }
772 --
773 - if(!(normalized = cli_malloc(SCANBUFF + maxpatlen))) {
774 - cli_dbgmsg("cli_scanscript: Unable to malloc %u bytes\n", SCANBUFF);
775 -- free(tmpname);
776 - return CL_EMEM;
777 - }
778 --
779 - text_normalize_init(&state, normalized, SCANBUFF + maxpatlen);
780 -- ret = CL_CLEAN;
781 --
782 -
783 - if ((ret = cli_ac_initdata(&tmdata, troot?troot->ac_partsigs:0, troot?troot->ac_lsigs:0, troot?troot->ac_reloff_num:0, CLI_DEFAULT_AC_TRACKLEN))) {
784 -- free(tmpname);
785 -+ free(normalized);
786 - return ret;
787 - }
788 -
789 - if ((ret = cli_ac_initdata(&gmdata, groot->ac_partsigs, groot->ac_lsigs, groot->ac_reloff_num, CLI_DEFAULT_AC_TRACKLEN))) {
790 - cli_ac_freedata(&tmdata);
791 -- free(tmpname);
792 -+ free(normalized);
793 - return ret;
794 - }
795 -
796 -+ /* dump to disk only if explicitly asked to
797 -+ * or if necessary to check relative offsets,
798 -+ * otherwise we can process just in-memory */
799 -+ if(ctx->engine->keeptmp || (troot && troot->ac_reloff_num > 0)) {
800 -+ if((ret = cli_gentempfd(ctx->engine->tmpdir, &tmpname, &ofd))) {
801 -+ cli_dbgmsg("cli_scanscript: Can't generate temporary file/descriptor\n");
802 -+ goto done;
803 -+ }
804 -+ if (ctx->engine->keeptmp)
805 -+ cli_dbgmsg("cli_scanscript: saving normalized file to %s\n", tmpname);
806 -+ }
807 -+
808 - mdata[0] = &tmdata;
809 - mdata[1] = &gmdata;
810 -
811 -@@ -1388,9 +1384,8 @@
812 -
813 - if (write(ofd, state.out, state.out_pos) == -1) {
814 - cli_errmsg("cli_scanscript: can't write to file %s\n",tmpname);
815 -- close(ofd);
816 -- free(tmpname);
817 -- return CL_EWRITE;
818 -+ ret = CL_EWRITE;
819 -+ goto done;
820 - }
821 - text_normalize_reset(&state);
822 - }
823 -@@ -1409,11 +1404,6 @@
824 - funmap(*ctx->fmap);
825 - }
826 - *ctx->fmap = map;
827 --
828 -- /* If we aren't keeping temps, delete the normalized file after scan. */
829 -- if(!(ctx->engine->keeptmp))
830 -- if (cli_unlink(tmpname)) ret = CL_EUNLINK;
831 --
832 - } else {
833 - /* Since the above is moderately costly all in all,
834 - * do the old stuff if there's no relative offsets. */
835 -@@ -1421,11 +1411,8 @@
836 - if (troot) {
837 - cli_targetinfo(&info, 7, map);
838 - ret = cli_ac_caloff(troot, &tmdata, &info);
839 -- if (ret) {
840 -- cli_ac_freedata(&tmdata);
841 -- free(tmpname);
842 -- return ret;
843 -- }
844 -+ if (ret)
845 -+ goto done;
846 - }
847 -
848 - while(1) {
849 -@@ -1466,13 +1453,6 @@
850 -
851 - }
852 -
853 -- if(ctx->engine->keeptmp) {
854 -- free(tmpname);
855 -- if (ofd >= 0)
856 -- close(ofd);
857 -- }
858 -- free(normalized);
859 --
860 - if(ret != CL_VIRUS || SCAN_ALL) {
861 - if ((ret = cli_exp_eval(ctx, troot, &tmdata, NULL, NULL)) == CL_VIRUS)
862 - viruses_found++;
863 -@@ -1481,9 +1461,19 @@
864 - viruses_found++;
865 - }
866 -
867 -+done:
868 -+ free(normalized);
869 - cli_ac_freedata(&tmdata);
870 - cli_ac_freedata(&gmdata);
871 -
872 -+ if (ofd != -1)
873 -+ close(ofd);
874 -+ if (tmpname != NULL) {
875 -+ if (!ctx->engine->keeptmp)
876 -+ if (cli_unlink(tmpname)) ret = CL_EUNLINK;
877 -+ free(tmpname);
878 -+ }
879 -+
880 - if (SCAN_ALL && viruses_found)
881 - return CL_VIRUS;
882 -
883
884 diff --git a/app-antivirus/clamav/files/clamav-0.99.4-fix-newer-zlib.patch b/app-antivirus/clamav/files/clamav-0.99.4-fix-newer-zlib.patch
885 deleted file mode 100644
886 index 1867341..0000000
887 --- a/app-antivirus/clamav/files/clamav-0.99.4-fix-newer-zlib.patch
888 +++ /dev/null
889 @@ -1,54 +0,0 @@
890 -https://bugs.gentoo.org/649516
891 -
892 -Description: fix compatibility with zlib 1.2.9 and newer
893 -Author: Marc Deslauriers <marc.deslauriers@×××××××××.com>
894 -Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/clamav/+bug/1692073
895 -
896 -Index: clamav-0.99.2+dfsg/libclamav/bytecode_api.c
897 -===================================================================
898 ---- clamav-0.99.2+dfsg.orig/libclamav/bytecode_api.c 2017-08-08 15:20:06.651685637 -0400
899 -+++ clamav-0.99.2+dfsg/libclamav/bytecode_api.c 2017-08-15 15:45:14.645714766 -0400
900 -@@ -811,8 +811,20 @@ int32_t cli_bcapi_inflate_init(struct cl
901 - cli_dbgmsg("bytecode api: inflate_init: invalid buffers!\n");
902 - return -1;
903 - }
904 -- memset(&stream, 0, sizeof(stream));
905 -- ret = inflateInit2(&stream, windowBits);
906 -+
907 -+ b = cli_realloc(ctx->inflates, sizeof(*ctx->inflates)*n);
908 -+ if (!b) {
909 -+ return -1;
910 -+ }
911 -+ ctx->inflates = b;
912 -+ ctx->ninflates = n;
913 -+ b = &b[n-1];
914 -+
915 -+ b->from = from;
916 -+ b->to = to;
917 -+ b->needSync = 0;
918 -+ memset(&b->stream, 0, sizeof(stream));
919 -+ ret = inflateInit2(&b->stream, windowBits);
920 - switch (ret) {
921 - case Z_MEM_ERROR:
922 - cli_dbgmsg("bytecode api: inflateInit2: out of memory!\n");
923 -@@ -829,20 +841,6 @@ int32_t cli_bcapi_inflate_init(struct cl
924 - cli_dbgmsg("bytecode api: inflateInit2: unknown error %d\n", ret);
925 - return -1;
926 - }
927 --
928 -- b = cli_realloc(ctx->inflates, sizeof(*ctx->inflates)*n);
929 -- if (!b) {
930 -- inflateEnd(&stream);
931 -- return -1;
932 -- }
933 -- ctx->inflates = b;
934 -- ctx->ninflates = n;
935 -- b = &b[n-1];
936 --
937 -- b->from = from;
938 -- b->to = to;
939 -- b->needSync = 0;
940 -- memcpy(&b->stream, &stream, sizeof(stream));
941 - return n-1;
942 - }
943 -
944
945 diff --git a/app-antivirus/clamav/files/clamav-0.99.4-pcre2-compile-erroffset.patch b/app-antivirus/clamav/files/clamav-0.99.4-pcre2-compile-erroffset.patch
946 deleted file mode 100644
947 index 5585ea6..0000000
948 --- a/app-antivirus/clamav/files/clamav-0.99.4-pcre2-compile-erroffset.patch
949 +++ /dev/null
950 @@ -1,11 +0,0 @@
951 ---- clamav-0.99.4/libclamav/regex_pcre.c_orig 2018-03-02 19:10:39.702899702 +0100
952 -+++ clamav-0.99.4/libclamav/regex_pcre.c 2018-03-02 19:09:27.600901912 +0100
953 -@@ -112,7 +112,8 @@
954 - #if USING_PCRE2
955 - int cli_pcre_compile(struct cli_pcre_data *pd, long long unsigned match_limit, long long unsigned match_limit_recursion, unsigned int options, int opt_override)
956 - {
957 -- int errornum, erroffset;
958 -+ int errornum;
959 -+ size_t erroffset;
960 - pcre2_general_context *gctx;
961 - pcre2_compile_context *cctx;
962
963 diff --git a/app-antivirus/clamav/files/freshclamd.service b/app-antivirus/clamav/files/freshclamd.service
964 index a0a72c2..2148768 100644
965 --- a/app-antivirus/clamav/files/freshclamd.service
966 +++ b/app-antivirus/clamav/files/freshclamd.service
967 @@ -3,6 +3,9 @@ Description=clamav updater
968
969 [Service]
970 Type=forking
971 +User=clamav
972 +Group=clamav
973 +RuntimeDirectory=clamav
974 PIDFile=/run/clamav/freshclam.pid
975 ExecStart=/usr/bin/freshclam -d -p /run/clamav/freshclam.pid
976
977
978 diff --git a/app-antivirus/clamav/metadata.xml b/app-antivirus/clamav/metadata.xml
979 index 5ddb818..e81808e 100644
980 --- a/app-antivirus/clamav/metadata.xml
981 +++ b/app-antivirus/clamav/metadata.xml
982 @@ -13,6 +13,7 @@
983 <flag name="clamdtop">A Top like tool which shows what clamd is currently scanning amongst other things</flag>
984 <flag name="metadata-analysis-api">Enables collection of file property metadata using ClamAV API for analysis by ClamAV bytecode programs.</flag>
985 <flag name="system-libmspack">Use system libmspack instead of built in</flag>
986 + <flag name="xml">DMG and XAR support</flag>
987 </use>
988 <upstream>
989 <remote-id type="sourceforge">clamav</remote-id>