diff options
author | Tobias Scherbaum <dertobi123@gentoo.org> | 2009-05-17 08:09:01 +0000 |
---|---|---|
committer | Tobias Scherbaum <dertobi123@gentoo.org> | 2009-05-17 08:09:01 +0000 |
commit | 3854ae1697f092ff9c4ee18516d9018927cd9b86 (patch) | |
tree | 30966f5490ef06af931c23c0343a5ff9deef951d /dev-python/pyclamav | |
parent | Accidentally missed spanish translation, bug #269601 (diff) | |
download | gentoo-2-3854ae1697f092ff9c4ee18516d9018927cd9b86.tar.gz gentoo-2-3854ae1697f092ff9c4ee18516d9018927cd9b86.tar.bz2 gentoo-2-3854ae1697f092ff9c4ee18516d9018927cd9b86.zip |
non maintainer revbump, incorporate patch from debian to build w/ clamav-0.95. #264842. (blocks security bug #265545.)
(Portage version: 2.2_rc33/cvs/Linux x86_64)
Diffstat (limited to 'dev-python/pyclamav')
-rw-r--r-- | dev-python/pyclamav/ChangeLog | 11 | ||||
-rw-r--r-- | dev-python/pyclamav/files/pyclamav-0.4.1-clamav-0.95.patch | 126 | ||||
-rw-r--r-- | dev-python/pyclamav/pyclamav-0.4.1-r1.ebuild | 34 |
3 files changed, 169 insertions, 2 deletions
diff --git a/dev-python/pyclamav/ChangeLog b/dev-python/pyclamav/ChangeLog index 6a7c7ce3af38..e11a48c5af73 100644 --- a/dev-python/pyclamav/ChangeLog +++ b/dev-python/pyclamav/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for dev-python/pyclamav -# Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/pyclamav/ChangeLog,v 1.20 2008/05/14 20:48:00 maekke Exp $ +# Copyright 2000-2009 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/pyclamav/ChangeLog,v 1.21 2009/05/17 08:09:01 dertobi123 Exp $ + +*pyclamav-0.4.1-r1 (17 May 2009) + + 17 May 2009; Tobias Scherbaum <dertobi123@gentoo.org> + +files/pyclamav-0.4.1-clamav-0.95.patch, +pyclamav-0.4.1-r1.ebuild: + non maintainer revbump, incorporate patch from debian to build w/ + clamav-0.95. #264842. (blocks security bug #265545.) 14 May 2008; Markus Meier <maekke@gentoo.org> pyclamav-0.4.1.ebuild: x86 stable, bug #221937 diff --git a/dev-python/pyclamav/files/pyclamav-0.4.1-clamav-0.95.patch b/dev-python/pyclamav/files/pyclamav-0.4.1-clamav-0.95.patch new file mode 100644 index 000000000000..1cf77e1925e7 --- /dev/null +++ b/dev-python/pyclamav/files/pyclamav-0.4.1-clamav-0.95.patch @@ -0,0 +1,126 @@ + +--- python-clamav-0.4.1.orig/pyclamav.c ++++ python-clamav-0.4.1/pyclamav.c +@@ -33,25 +33,6 @@ + + /* ********************************************************* */ + +-/* To be able to compile with +- releases 0.75 of libclamav +- +- Where cl_free was cl_freetrie +- and cl_build was cl_buildtrie +- CL_SCAN_STDOPT did not exist +-*/ +-#ifndef CL_SCAN_STDOPT +-#define CL_SCAN_STDOPT CL_RAW | CL_ARCHIVE | CL_MAIL | CL_DISABLERAR | CL_OLE2 | CL_ENCRYPTED +-void cl_free(struct cl_node *rootnode) { +- cl_freetrie(rootnode); +- return; +-} +- +-int cl_build(struct cl_node *rootnode) { +- return cl_buildtrie(rootnode); +-} +-#endif +- + /* For python prior to 2.3 */ + #ifndef PyMODINIT_FUNC + #define PyMODINIT_FUNC void +@@ -68,11 +49,9 @@ + unsigned int signumber = 0; + + /* Structures for clamav */ +-struct cl_node *root = NULL; +-struct cl_limits limits; ++struct cl_engine *engine = NULL; + struct cl_stat dbstat; + +- + /* + * If the virus database has been changed, then + * free the current tree and reload the new one +@@ -85,22 +64,22 @@ + /* If yes : reload DB */ + if (cl_statchkdir(&dbstat) == 1) + { +- /* free the tree */ +- cl_free(root); ++ /* free the engine */ ++ cl_engine_free(engine); + signumber=0; +- root=NULL; ++ engine=NULL; + + /* Load DB */ +- if((ret = cl_load(cl_retdbdir(), &root, &signumber, CL_DB_STDOPT))) { ++ if((ret = cl_load(cl_retdbdir(), engine, &signumber, CL_DB_STDOPT)) != CL_SUCCESS) { + /* Raise exception with error message */ + PyErr_SetString(PyclamavError, cl_strerror(ret)); + return -2; + } + +- /* build the final tree */ +- if((ret = cl_build(root))) { +- /* free the partial tree */ +- cl_free(root); ++ /* prepare the engine */ ++ if((ret = cl_engine_compile(engine))) { ++ /* free the engine */ ++ cl_engine_free(engine); + /* Raise exception with error message */ + PyErr_SetString(PyclamavError, cl_strerror(ret)); + return -2; +@@ -231,7 +210,7 @@ + return NULL; + } + +- ret = cl_scanfile(file_to_scan, &virname, &size, root, &limits, CL_SCAN_STDOPT); ++ ret = cl_scanfile(file_to_scan, &virname, &size, engine, CL_SCAN_STDOPT); + + /* Test return code */ + switch (ret) { +@@ -278,17 +257,21 @@ + /* 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 [norman@xael.org]\n\nFunctions :\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")); + ++ /* initialize libclamav */ ++ cl_init(CL_INIT_DEFAULT); ++ engine = cl_engine_new(); + +- if((ret = cl_load(cl_retdbdir(), &root, &signumber, CL_DB_STDOPT))) { ++ if((ret = cl_load(cl_retdbdir(), engine, &signumber, CL_DB_STDOPT))) { + /* Raise exception with error message */ + PyErr_SetString(PyclamavError, cl_strerror(ret)); ++ cl_engine_free(engine); + return; + } + +- /* build the final tree */ +- if((ret = cl_build(root))) { +- /* free the partial tree */ +- cl_free(root); ++ /* prepare the engine */ ++ if((ret = cl_engine_compile(engine)) != CL_SUCCESS) { ++ /* free up the engine resources */ ++ cl_engine_free(engine); + /* Raise exception with error message */ + PyErr_SetString(PyclamavError, cl_strerror(ret)); + return; +@@ -299,15 +282,6 @@ + memset(&dbstat, 0, sizeof(struct cl_stat)); + cl_statinidir(cl_retdbdir(), &dbstat); + +- +- +- /* set up archive limits */ +- memset(&limits, 0, sizeof(struct cl_limits)); +- limits.maxfiles = 1000; /* max files */ +- limits.maxfilesize = 10 * 1048576; /* maximal archived file size == 10 Mb */ +- limits.maxreclevel = 5; /* maximal recursion level */ +- limits.archivememlim = 0; /* disable memory limit for bzip2 scanner */ +- + return ; + } + + diff --git a/dev-python/pyclamav/pyclamav-0.4.1-r1.ebuild b/dev-python/pyclamav/pyclamav-0.4.1-r1.ebuild new file mode 100644 index 000000000000..15041c10bceb --- /dev/null +++ b/dev-python/pyclamav/pyclamav-0.4.1-r1.ebuild @@ -0,0 +1,34 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/pyclamav/pyclamav-0.4.1-r1.ebuild,v 1.1 2009/05/17 08:09:01 dertobi123 Exp $ + +EAPI=2 + +NEED_PYTHON=2.2 + +inherit distutils eutils + +DESCRIPTION="Python binding for libclamav" +HOMEPAGE="http://xael.org/norman/python/pyclamav/" +SRC_URI="http://xael.org/norman/python/${PN}/${P}.tar.gz" +LICENSE="GPL-2" +KEYWORDS="~amd64 ~ia64 ~ppc ~x86" +DEPEND=">=app-antivirus/clamav-0.90" +SLOT="0" +IUSE="" + +src_prepare() { + # Patch from Debian to build w/ >=clamav-0.95 + epatch "${FILESDIR}/${P}-clamav-0.95.patch" +} + +src_install() { + distutils_src_install + insinto /usr/share/doc/${PF} && doins example.py +} + +pkg_postinst() { + elog "Due to removal of cl_scanbuff in libclamav, pyclamav.scanthis()" + elog "has been removed in this release. Authors strongly encourage to use" + elog "pyClamd (http://xael.org/norman/python/pyclamd)." +} |