Package: dansguardian
Version: 2.9.9.7-2
Severity: normal

This package needs to be updated to support the new clamav release 
(clamav 0.95/libclamav6). Proposed NMU diff is attached.

-- System Information:
Debian Release: 5.0.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages dansguardian depends on:
ii  adduser              3.110               add and remove users and groups
ii  clamav               0.94.dfsg.2-1lenny2 anti-virus utility for Unix - comm
ii  libbz2-1.0           1.0.5-1             high-quality block-sorting file co
ii  libc6                2.7-18              GNU C Library: Shared libraries
ii  libclamav5           0.94.dfsg.2-1lenny2 anti-virus utility for Unix - libr
ii  libgcc1              1:4.3.2-1.1         GCC support library
ii  libgmp3c2            2:4.2.2+dfsg-3      Multiprecision arithmetic library
ii  libpcre3             7.8-2+b1            Perl 5 Compatible Regular Expressi
ii  libstdc++6           4.3.2-1.1           The GNU Standard C++ Library v3
ii  perl                 5.10.0-19           Larry Wall's Practical Extraction 
ii  zlib1g               1:1.2.3.3.dfsg-12   compression library - runtime

dansguardian recommends no packages.

Versions of packages dansguardian suggests:
ii  clamav-freshclam     0.94.dfsg.2-1lenny2 anti-virus utility for Unix - viru
pn  squid                <none>              (no description available)

-- no debconf information
diff -u dansguardian-2.9.9.7/debian/changelog dansguardian-2.9.9.7/debian/changelog
--- dansguardian-2.9.9.7/debian/changelog
+++ dansguardian-2.9.9.7/debian/changelog
@@ -1,3 +1,11 @@
+dansguardian (2.9.9.7-2.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Added patch for clamav 0.95/libclamav6 support
+    - added debian/patches/50_clamav095_support.dpatch 
+
+ -- Imre Gergely <gi...@narancs.net>  Sun, 19 Apr 2009 09:42:35 +0300
+
 dansguardian (2.9.9.7-2) unstable; urgency=low
 
   [ Thomas Viehmann ]
diff -u dansguardian-2.9.9.7/debian/patches/00list dansguardian-2.9.9.7/debian/patches/00list
--- dansguardian-2.9.9.7/debian/patches/00list
+++ dansguardian-2.9.9.7/debian/patches/00list
@@ -5,0 +6 @@
+50_clamav095_support.dpatch
only in patch2:
unchanged:
--- dansguardian-2.9.9.7.orig/debian/patches/50_clamav095_support.dpatch
+++ dansguardian-2.9.9.7/debian/patches/50_clamav095_support.dpatch
@@ -0,0 +1,171 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 50_clamav095_support.dpatch by Imre Gergely <gi...@narancs.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Adds support for clamav 0.95
+
+...@dpatch@
+diff -urNad dansguardian-2.9.9.7~/src/contentscanners/clamav.cpp dansguardian-2.9.9.7/src/contentscanners/clamav.cpp
+--- dansguardian-2.9.9.7~/src/contentscanners/clamav.cpp	2008-06-10 12:41:41.000000000 +0300
++++ dansguardian-2.9.9.7/src/contentscanners/clamav.cpp	2009-04-19 09:47:39.000000000 +0300
+@@ -69,9 +69,11 @@
+ 	// virus database root node
+ 	// Update to support ClamAV 0.90
+ 	// Based on patch supplied by Aecio F. Neto
+-	struct cl_engine *root;
++	struct cl_engine *engine;
++#ifndef CL_INIT_DEFAULT
+ 	// archive limit options
+ 	struct cl_limits limits;
++#endif
+ 
+ #ifdef HAVE_CLAMAV_SHM
+ 	// use POSIX shared memory
+@@ -100,7 +102,11 @@
+ // destroy plugin
+ int clamavinstance::quit()
+ {
+-	cl_free(root);
++#ifdef CL_INIT_DEFAULT
++	cl_engine_free(engine);
++#else
++	cl_free(engine);
++#endif
+ 	return DGCS_OK;
+ }
+ 
+@@ -164,7 +170,11 @@
+ 		return DGCS_SCANERROR;
+ 	}
+ 
+-	rc = cl_scandesc(fd, &vn, NULL, root, &limits, CL_SCAN_STDOPT);
++#ifdef CL_INIT_DEFAULT
++	rc = cl_scandesc(fd, &vn, NULL, engine, CL_SCAN_STDOPT);
++#else
++	rc = cl_scandesc(fd, &vn, NULL, engine, &limits, CL_SCAN_STDOPT);
++#endif
+ 	close(fd);
+ 
+ #ifdef HAVE_CLAMAV_SHM
+@@ -189,7 +199,11 @@
+ {
+ 	lastmessage = lastvirusname = "";
+ 	const char *vn = NULL;
+-	int rc = cl_scanfile(filename, &vn, NULL, root, &limits, CL_SCAN_STDOPT );
++#ifdef CL_INIT_DEFAULT
++	int rc = cl_scanfile(filename, &vn, NULL, engine, CL_SCAN_STDOPT );
++#else
++	int rc = cl_scanfile(filename, &vn, NULL, engine, &limits, CL_SCAN_STDOPT );
++#endif
+ 	return doRC(rc, vn);
+ }
+ 
+@@ -220,6 +234,7 @@
+ // initialise libclamav
+ int clamavinstance::init(void* args)
+ {
++	int rc;
+ 	// always include these lists
+ 	if (!readStandardLists()) {
+ 		return DGCS_ERROR;
+@@ -244,18 +259,41 @@
+ 		return DGCS_ERROR;
+ 	}
+ 
+-	// set clam's own temp dir
+-	if (cv["tempdir"].length() > 0)
+-		cl_settempdir(cv["tempdir"].toCharArray(), 0);
+-
+ #ifdef DGDEBUG
+ 	std::cout << "Scanbuffmethod: " << smethod << std::endl;
+ 	std::cout << "Scanbuffdir: " << memdir << std::endl;
+ 	std::cout << "Tempdir: " << cv["tempdir"] << std::endl;
+ #endif
+ 
++#ifdef CL_INIT_DEFAULT
++	if ( (rc = cl_init(CL_INIT_DEFAULT)) != CL_SUCCESS ) {
++		return DGCS_ERROR;
++    	}
++	if ( !(engine = cl_engine_new()) ) {
++		return DGCS_ERROR;
++    	}
++
+ 	// set file, recursion and compression ratio limits for scanning archives
+-	root = NULL;
++	if ( (rc = cl_engine_set_num(engine, CL_ENGINE_MAX_FILES, (long long)cv["maxfiles"].toInteger())) ) {
++		return DGCS_ERROR;
++	}
++	if ( (rc = cl_engine_set_num(engine, CL_ENGINE_MAX_FILESIZE, (long long)o.max_content_filecache_scan_size + 1024 * 1024)) ) {
++		return DGCS_ERROR;
++	}
++	if ( (rc = cl_engine_set_num(engine, CL_ENGINE_MAX_RECURSION, (long long)cv["maxreclevel"].toInteger())) ) {
++		return DGCS_ERROR;
++	}
++	if ( (rc = cl_engine_set_num(engine, CL_ENGINE_MAX_SCANSIZE, (long long)cv["maxscansize"].toInteger() * 1024)) ) {
++		return DGCS_ERROR;
++	}
++// FIXME: need debug output code here
++	if (cv["tempdir"].length() > 0)
++        	if ( (rc = cl_engine_set_str(engine, CL_ENGINE_TMPDIR, cv["tempdir"].toCharArray())) ) {
++                	return DGCS_ERROR;
++        	}
++#else
++	// set file, recursion and compression ratio limits for scanning archives
++	engine = NULL;
+ 	limits.maxfiles = cv["maxfiles"].toInteger();
+ 	limits.maxfilesize = o.max_content_filecache_scan_size + 1024 * 1024;
+ 	limits.maxreclevel = cv["maxreclevel"].toInteger();
+@@ -264,12 +302,35 @@
+ 	std::cerr << "maxfiles: " << limits.maxfiles << " maxfilesize: " << limits.maxfilesize
+ 		<< " maxreclevel: " << limits.maxreclevel << " maxscansize: " << limits.maxscansize << std::endl;
+ #endif
++	if (cv["tempdir"].length() > 0)
++		cl_settempdir(cv["tempdir"].toCharArray(), 0);
++
++#endif
+ 
+ 	// load virus database
+-	unsigned int virnum = 0;
+-	int rc = cl_load(cl_retdbdir(), &root, &virnum, CL_DB_STDOPT);
++	unsigned int sigs = 0;
++#ifdef CL_INIT_DEFAULT
++	if ( (rc = cl_load(cl_retdbdir(), engine, &sigs, 0)) != CL_SUCCESS ) {
++		if (!is_daemonised)
++                	std::cerr << "Error loading clamav db: " << cl_strerror(rc) << std::endl;
++                syslog(LOG_ERR, "Error loading clamav db: %s", cl_strerror(rc));
++		return DGCS_ERROR;
++	}
+ #ifdef DGDEBUG
+-	std::cout << "engine: " << root << " virnum: " << virnum << std::endl;
++        std::cout << "engine: " << engine << " sigs: " << sigs << std::endl;
++#endif
++	if ( (rc = cl_engine_compile(engine)) != CL_SUCCESS ) {
++        	if (!is_daemonised)
++                	std::cerr << "Error preparing clamav engine: " << cl_strerror(rc) << std::endl;
++                syslog(LOG_ERR, "Error preparing clamav engine: %s", cl_strerror(rc));
++                return DGCS_ERROR;
++	}
++	return DGCS_OK;
++	
++#else
++	rc = cl_load(cl_retdbdir(), &engine, &sigs, CL_DB_STDOPT);
++#ifdef DGDEBUG
++	std::cout << "engine: " << engine << " sigs: " << sigs << std::endl;
+ #endif
+ 	if (rc != 0) {
+ 		if (!is_daemonised)
+@@ -277,7 +338,7 @@
+ 		syslog(LOG_ERR, "Error loading clamav db: %s", cl_strerror(rc));
+ 		return DGCS_ERROR;
+ 	}
+-	rc = cl_build(root);
++	rc = cl_build(engine);
+ 	if (rc != 0) {
+ 		if (!is_daemonised)
+ 			std::cerr << "Error building clamav db: " << cl_strerror(rc) << std::endl;
+@@ -285,4 +346,5 @@
+ 		return DGCS_ERROR;
+ 	}
+ 	return DGCS_OK;
++#endif
+ }

Reply via email to