From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1M5bQd-0005kC-0s for garchives@archives.gentoo.org; Sun, 17 May 2009 08:09:03 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0364AE06F2; Sun, 17 May 2009 08:09:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B8C3AE06F2 for ; Sun, 17 May 2009 08:09:01 +0000 (UTC) Received: from stork.gentoo.org (stork.gentoo.org [64.127.104.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 6547C64A90 for ; Sun, 17 May 2009 08:09:01 +0000 (UTC) Received: from dertobi123 by stork.gentoo.org with local (Exim 4.69) (envelope-from ) id 1M5bQa-0005ad-Ts for gentoo-commits@lists.gentoo.org; Sun, 17 May 2009 08:09:00 +0000 From: "Tobias Scherbaum (dertobi123)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, dertobi123@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in dev-python/pyclamav/files: pyclamav-0.4.1-clamav-0.95.patch X-VCS-Repository: gentoo-x86 X-VCS-Files: pyclamav-0.4.1-clamav-0.95.patch X-VCS-Directories: dev-python/pyclamav/files X-VCS-Committer: dertobi123 X-VCS-Committer-Name: Tobias Scherbaum Content-Type: text/plain; charset=utf8 Message-Id: Sender: Tobias Scherbaum Date: Sun, 17 May 2009 08:09:00 +0000 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 348480b6-cd45-40c5-ad0c-a5f8e1206c18 X-Archives-Hash: 4f2f25170869a1b83cbebc6a545e9310 dertobi123 09/05/17 08:09:00 Added: pyclamav-0.4.1-clamav-0.95.patch Log: non maintainer revbump, incorporate patch from debian to build w/ clama= v-0.95. #264842. (blocks security bug #265545.) (Portage version: 2.2_rc33/cvs/Linux x86_64) Revision Changes Path 1.1 dev-python/pyclamav/files/pyclamav-0.4.1-clamav-0.95= .patch file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/pyclama= v/files/pyclamav-0.4.1-clamav-0.95.patch?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/pyclama= v/files/pyclamav-0.4.1-clamav-0.95.patch?rev=3D1.1&content-type=3Dtext/pl= ain Index: pyclamav-0.4.1-clamav-0.95.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- python-clamav-0.4.1.orig/pyclamav.c +++ python-clamav-0.4.1/pyclamav.c @@ -33,25 +33,6 @@ =20 /* ********************************************************* */ =20 -/* To be able to compile with=20 - releases 0.75 of libclamav=20 - - 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 | C= L_OLE2 | CL_ENCRYPTED -void cl_free(struct cl_node *rootnode) { - cl_freetrie(rootnode); =20 - return; =20 -}=20 - -int cl_build(struct cl_node *rootnode) { =20 - return cl_buildtrie(rootnode); =20 -}=20 -#endif - /* For python prior to 2.3 */ #ifndef PyMODINIT_FUNC #define PyMODINIT_FUNC void @@ -68,11 +49,9 @@ unsigned int signumber =3D 0; =20 /* Structures for clamav */ -struct cl_node *root =3D NULL; -struct cl_limits limits; +struct cl_engine *engine =3D NULL; struct cl_stat dbstat; =20 - /* * 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) =3D=3D 1) { - /* free the tree */ - cl_free(root);=20 + /* free the engine */ + cl_engine_free(engine);=20 signumber=3D0; - root=3DNULL; + engine=3DNULL; =20 /* Load DB */ - if((ret =3D cl_load(cl_retdbdir(), &root, &signumber, CL_DB_STDOPT= ))) { + if((ret =3D cl_load(cl_retdbdir(), engine, &signumber, CL_DB_STDOP= T)) !=3D CL_SUCCESS) { /* Raise exception with error message */ PyErr_SetString(PyclamavError, cl_strerror(ret)); return -2; } =20 - /* build the final tree */ - if((ret =3D cl_build(root))) { - /* free the partial tree */ - cl_free(root);=20 + /* prepare the engine */ + if((ret =3D cl_engine_compile(engine))) { + /* free the engine */ + cl_engine_free(engine);=20 /* Raise exception with error message */ PyErr_SetString(PyclamavError, cl_strerror(ret)); return -2; @@ -231,7 +210,7 @@ return NULL; =20 } =20 - ret =3D cl_scanfile(file_to_scan, &virname, &size, root, &limits, CL_S= CAN_STDOPT); + ret =3D cl_scanfile(file_to_scan, &virname, &size, engine, CL_SCAN_STD= OPT); =20 /* 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 Cla= mav 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\nAu= thor : Alexandre Norman [norman@xael.org]\n\nFunctions :\n - scanfile(st= ring filename) : Scan a file for virus.\n - get_numsig() : Return the nu= mber of known signatures.\n - get_version() : Return the version of Clam= av.\n - version() : Return the version of pyclamav.\n")); =20 + /* initialize libclamav */ + cl_init(CL_INIT_DEFAULT); + engine =3D cl_engine_new(); =20 - if((ret =3D cl_load(cl_retdbdir(), &root, &signumber, CL_DB_STDOPT))) = { + if((ret =3D 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; } =20 - /* build the final tree */ - if((ret =3D cl_build(root))) { - /* free the partial tree */ - cl_free(root);=20 + /* prepare the engine */ + if((ret =3D cl_engine_compile(engine)) !=3D CL_SUCCESS) { + /* free up the engine resources */ + cl_engine_free(engine);=20 /* 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); =20 - - - /* set up archive limits */ - memset(&limits, 0, sizeof(struct cl_limits)); - limits.maxfiles =3D 1000; /* max files */ - limits.maxfilesize =3D 10 * 1048576; /* maximal archived file size =3D= =3D 10 Mb */ - limits.maxreclevel =3D 5; /* maximal recursion level */ - limits.archivememlim =3D 0; /* disable memory limit for bzip2 scanner = */ - return ; } =20