--- Begin Message ---
Package: python-clamav
Version: 0.3.3-2
Severity: normal
Tags: patch
Hi,
Attached is the diff for my python-clamav 0.3.3-2.1 NMU.
I plan to upload this in the next day or so if you don't object.
Thanks,
--
-----------------------------------------------------------------
| ,''`. Stephen Gran |
| : :' : [EMAIL PROTECTED] |
| `. `' Debian user, admin, and developer |
| `- http://www.debian.org |
-----------------------------------------------------------------
diff -u python-clamav-0.3.3/debian/changelog python-clamav-0.3.3/debian/changelog
--- python-clamav-0.3.3/debian/changelog
+++ python-clamav-0.3.3/debian/changelog
@@ -1,3 +1,10 @@
+python-clamav (0.3.3-2.1) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Update to new clamav API
+
+ -- Stephen Gran <[EMAIL PROTECTED]> Wed, 28 Feb 2007 01:19:55 +0000
+
python-clamav (0.3.3-2) unstable; urgency=low
* Install example.py.
only in patch2:
unchanged:
--- python-clamav-0.3.3.orig/pyclamav.c
+++ python-clamav-0.3.3/pyclamav.c
@@ -91,7 +91,7 @@
root=NULL;
/* Load DB */
- if((ret = cl_loaddbdir(cl_retdbdir(), &root, &signumber))) {
+ if((ret = cl_load(cl_retdbdir(), &root, &signumber, CL_DB_STDOPT))) {
/* Raise exception with error message */
PyErr_SetString(PyclamavError, cl_strerror(ret));
return -2;
@@ -253,7 +253,7 @@
/*
* Scan a buffer given as a parameter
- */
+
static PyObject *pyclamav_scanthis(PyObject *self, PyObject *args)
{
const char *buffer_to_scan;
@@ -263,7 +263,7 @@
int ret = 0;
- /* Raise exception if database error */
+ // Raise exception if database error
if (if_database_have_changed_then_reload() == -2) {
PyErr_SetString(PyExc_TypeError, "Error with the virus database");
return NULL;
@@ -271,33 +271,34 @@
if (!PyArg_ParseTuple(args, "s#", &buffer_to_scan, &size)) {
- /* Raise exception with error message */
+ // Raise exception with error message
PyErr_SetString(PyExc_TypeError, "Pass buffer to scan (string) as argument");
return NULL;
}
- /* Scan buffer */
+ // Scan buffer
ret = cl_scanbuff(buffer_to_scan, size, &virname, root);
- /* Test return code */
+ // Test return code
switch (ret) {
- case CL_VIRUS : /* File contains a virus */
+ case CL_VIRUS : // File contains a virus
return Py_BuildValue("(i,s)", 1, virname);
break;
- case CL_CLEAN : /* File is clean */
+ case CL_CLEAN : // File is clean
return Py_BuildValue("(i,s)", 0, "");
break;
- default: /* Error : raise exception with message */
+ default: // Error : raise exception with message
PyErr_SetString(PyExc_ValueError, cl_strerror(ret));
return NULL;
}
}
+*/
static PyMethodDef ClamavMethods[] = {
{"scanfile", pyclamav_scanfile, METH_VARARGS, "scanfile(filename) : Scan a file for virus.\nArguments : filename (string)\n Return a tupple (status, virusname) where status=0 when no virus found\n or status=1 if a virus was found\n May raise a ValueError exception if an error occurs\n May raise a TypeError exception if wrong arguments are passed\n"},
- {"scanthis", pyclamav_scanthis, METH_VARARGS, "scanthis(buffer) : Scan a buffer for virus.\nArguments : buffer (string)\n Return a tupple (status, virusname) where status=0 when no virus found\n or status=1 if a virus was found\n May raise a ValueError exception if an error occurs\n May raise a TypeError exception if wrong arguments are passed\n"},
+ /* {"scanthis", pyclamav_scanthis, METH_VARARGS, "scanthis(buffer) : Scan a buffer for virus.\nArguments : buffer (string)\n Return a tupple (status, virusname) where status=0 when no virus found\n or status=1 if a virus was found\n May raise a ValueError exception if an error occurs\n May raise a TypeError exception if wrong arguments are passed\n"}, */
{"get_numsig", pyclamav_get_numsig, METH_VARARGS, "get_numsig() : Get the number of know virii signatures\nArguments : None\n Return the number of known signatures.\n"},
{"get_version", pyclamav_get_version, METH_VARARGS, "get_version() : Get Clamav version.\nArguments : None\n Return the version of Clamav as a tupple (version, daily_version, daily_date).\n"},
{"version", pyclamav_version, METH_VARARGS, "version() : Get pyclamav version.\nArguments : None\n Return the version of pyclamav.\n"},
@@ -320,10 +321,10 @@
/* Set documentation string for the module */
- PyDict_SetItemString(dict, "__doc__", PyString_FromString("pyclamav :\n\n This is a python binding to the C libclamav library\n (from the Clamav project - http://www.clamav.net).\n It can be used to easily allow a Python script to scan\n a file or a buffer against known viruses.\n\nAuthor : Alexandre Norman [EMAIL PROTECTED] :\n - scanfile(string filename) : Scan a file for virus.\n - scanthis(string buffer) : Scan a buffer for virus.\n - get_numsig() : Return the number of known signatures.\n - get_version() : Return the version of Clamav.\n - version() : Return the version of pyclamav.\n"));
+ PyDict_SetItemString(dict, "__doc__", PyString_FromString("pyclamav :\n\n This is a python binding to the C libclamav library\n (from the Clamav project - http://www.clamav.net).\n It can be used to easily allow a Python script to scan\n a file against known viruses.\n\nAuthor : Alexandre Norman [EMAIL PROTECTED] :\n - scanfile(string filename) : Scan a file for virus.\n - get_numsig() : Return the number of known signatures.\n - get_version() : Return the version of Clamav.\n - version() : Return the version of pyclamav.\n"));
- if((ret = cl_loaddbdir(cl_retdbdir(), &root, &signumber))) {
+ if((ret = cl_load(cl_retdbdir(), &root, &signumber, CL_DB_STDOPT))) {
/* Raise exception with error message */
PyErr_SetString(PyclamavError, cl_strerror(ret));
return;
signature.asc
Description: Digital signature
--- End Message ---