File: python-clamav-add-support-for-clamav-0.101.0.patch

package info (click to toggle)
python-clamav 0.4.1-11
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 160 kB
  • sloc: ansic: 473; python: 102; makefile: 27
file content (40 lines) | stat: -rw-r--r-- 1,292 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Date: Wed, 30 Jan 2019 23:22:55 +0100
Subject: [PATCH] python-clamav: add support for clamav 0.101.0

CL_SCAN_GENERAL_ALLMATCHES with all parses should do what CL_SCAN_STDOPT
did.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
---
 pyclamav.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pyclamav.c b/pyclamav.c
index 7ccd57239b97..0315c62ea81a 100644
--- a/pyclamav.c
+++ b/pyclamav.c
@@ -191,6 +191,7 @@ static PyObject *pyclamav_scanfile(PyObject *self, PyObject *args)
   char *file_to_scan;
   unsigned long int size = 0;
   const char *virname;
+  struct cl_scan_options scan_options;
   int ret = 0;
 
   /* Raise exception if database error */
@@ -209,8 +210,11 @@ static PyObject *pyclamav_scanfile(PyObject *self, PyObject *args)
     PyErr_SetString(PyExc_ValueError,  "Argument is not a filename");
     return NULL;     
   }
+  memset(&scan_options, 0, sizeof(scan_options));
+  scan_options.general = CL_SCAN_GENERAL_ALLMATCHES;
+  scan_options.parse = ~0;
 
-  ret = cl_scanfile(file_to_scan, &virname, &size, engine, CL_SCAN_STDOPT);
+  ret = cl_scanfile(file_to_scan, &virname, &size, engine, &scan_options);
 
   /* Test return code */
   switch (ret) {
-- 
2.11.0