[debian-edu-commits] debian-edu/pkg-team/ 01/03: DansGuardian inheritage: Drop all DansGuardian patches except 65-fix_clamdsocket.dpatch (see next commit).

Mike Gabriel sunweaver at debian.org
Wed Sep 7 14:37:26 UTC 2016


This is an automated email from the git hooks/post-receive script.

sunweaver pushed a commit to branch master
in repository e2guardian.

commit c7c5f087155d33230039a8b9f2070e361a3107c7
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Wed Sep 7 16:35:56 2016 +0200

    DansGuardian inheritage: Drop all DansGuardian patches except 65-fix_clamdsocket.dpatch (see next commit).
---
 debian/patches.Dansguardian_REMOVE-LATER/00list    |   9 --
 .../03_add_unconfigures.dpatch                     |  19 ---
 .../07_fix_config_paths.dpatch                     |  19 ---
 .../11_FixOptionContainer.cpp_on_arm.dpatch        |  39 -----
 .../50_clamav095_support.dpatch                    | 171 ---------------------
 .../60_add_gcc4.4_support.dpatch                   |  51 ------
 .../65-fix_clamdsocket.dpatch                      |  19 ---
 .../70-gcc4.6.dpatch                               |  19 ---
 .../70_fix_clamav_detection                        |  18 ---
 ...ix_libcre3_max_sub_expression_allocation.dpatch |  61 --------
 10 files changed, 425 deletions(-)

diff --git a/debian/patches.Dansguardian_REMOVE-LATER/00list b/debian/patches.Dansguardian_REMOVE-LATER/00list
deleted file mode 100644
index fdf0193..0000000
--- a/debian/patches.Dansguardian_REMOVE-LATER/00list
+++ /dev/null
@@ -1,9 +0,0 @@
-#03_add_unconfigures.dpatch
-#07_fix_config_paths.dpatch
-#11_FixOptionContainer.cpp_on_arm.dpatch
-#50_clamav095_support.dpatch
-#60_add_gcc4.4_support.dpatch
-#65-fix_clamdsocket.dpatch
-#70-gcc4.6.dpatch
-#70_fix_clamav_detection
-#80_fix_libcre3_max_sub_expression_allocation
diff --git a/debian/patches.Dansguardian_REMOVE-LATER/03_add_unconfigures.dpatch b/debian/patches.Dansguardian_REMOVE-LATER/03_add_unconfigures.dpatch
deleted file mode 100644
index 437a9b1..0000000
--- a/debian/patches.Dansguardian_REMOVE-LATER/03_add_unconfigures.dpatch
+++ /dev/null
@@ -1,19 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 03_add_unconfigures.dpatch by Alexander Wirt <formorer at debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Don't start dansguardian if its not configured
-
- at DPATCH@
-diff -urNad dansguardian-2.9.9.3~/configs/dansguardian.conf.in dansguardian-2.9.9.3/configs/dansguardian.conf.in
---- dansguardian-2.9.9.3~/configs/dansguardian.conf.in	2007-11-26 13:00:06.000000000 +0100
-+++ dansguardian-2.9.9.3/configs/dansguardian.conf.in	2008-03-23 09:41:22.000000000 +0100
-@@ -2,6 +2,7 @@
- 
- # **NOTE** as of version 2.7.5 most of the list files are now in dansguardianf1.conf
- 
-+UNCONFIGURED - Please remove this line after configuration
- 
- # Web Access Denied Reporting (does not affect logging)
- #
-
diff --git a/debian/patches.Dansguardian_REMOVE-LATER/07_fix_config_paths.dpatch b/debian/patches.Dansguardian_REMOVE-LATER/07_fix_config_paths.dpatch
deleted file mode 100644
index 1df9cae..0000000
--- a/debian/patches.Dansguardian_REMOVE-LATER/07_fix_config_paths.dpatch
+++ /dev/null
@@ -1,19 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## fix_config_paths.dpatch by Alexander Wirt <formorer at debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Fix config paths for language files
-
- at DPATCH@
-diff -urNad dansguardian-2.9.9.3~/configs/dansguardian.conf.in dansguardian-2.9.9.3/configs/dansguardian.conf.in
---- dansguardian-2.9.9.3~/configs/dansguardian.conf.in	2007-11-26 13:00:06.000000000 +0100
-+++ dansguardian-2.9.9.3/configs/dansguardian.conf.in	2008-03-22 22:25:50.000000000 +0100
-@@ -20,7 +20,7 @@
- # and easier to customise the access denied page.
- # The language file is used no matter what setting however.
- #
--languagedir = '@DGDATADIR@/languages'
-+languagedir = '@DGCONFDIR@/languages'
- 
- # language to use from languagedir.
- language = 'ukenglish'
diff --git a/debian/patches.Dansguardian_REMOVE-LATER/11_FixOptionContainer.cpp_on_arm.dpatch b/debian/patches.Dansguardian_REMOVE-LATER/11_FixOptionContainer.cpp_on_arm.dpatch
deleted file mode 100644
index e5ec907..0000000
--- a/debian/patches.Dansguardian_REMOVE-LATER/11_FixOptionContainer.cpp_on_arm.dpatch
+++ /dev/null
@@ -1,39 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 11_FixOptionContainer.cpp_on_arm.dpatch by Alexander Wirt <formorer at debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: If you need to iterate through all lines in the
-##     config file to find a field, at least don't abuse the configfile deque
-##     by accessing it as if it was an array with signed index.
-##     Works way better on arm, too, i.e. closes: #493047.
-
- at DPATCH@
-diff -urNad dansguardian-2.9.9.7~/src/OptionContainer.cpp dansguardian-2.9.9.7/src/OptionContainer.cpp
---- dansguardian-2.9.9.7~/src/OptionContainer.cpp	2008-08-18 09:57:46.000000000 +0200
-+++ dansguardian-2.9.9.7/src/OptionContainer.cpp	2008-10-13 09:23:20.000000000 +0200
-@@ -662,8 +662,10 @@
- 	String temp;
- 	String temp2;
- 	String o(option);
--	for (int i = 0; i < (signed) conffile.size(); i++) {
--		temp = conffile[i].c_str();
-+	for (std::deque<std::string>::iterator i = conffile.begin(); i != conffile.end(); i++) {
-+		if ((*i).empty())
-+			continue;
-+		temp = (*i).c_str();
- 		temp2 = temp.before("=");
- 		while (temp2.endsWith(" ")) {	// get rid of tailing spaces before =
- 			temp2.chop();
-@@ -696,8 +698,10 @@
- 	String temp2;
- 	String o(option);
- 	std::deque<String > results;
--	for (int i = 0; i < (signed) conffile.size(); i++) {
--		temp = conffile[i].c_str();
-+	for (std::deque<std::string>::iterator i = conffile.begin(); i != conffile.end(); i++) {
-+		if ((*i).empty())
-+			continue;
-+		temp = (*i).c_str();
- 		temp2 = temp.before("=");
- 		while (temp2.endsWith(" ")) {	// get rid of tailing spaces before =
- 			temp2.chop();
diff --git a/debian/patches.Dansguardian_REMOVE-LATER/50_clamav095_support.dpatch b/debian/patches.Dansguardian_REMOVE-LATER/50_clamav095_support.dpatch
deleted file mode 100644
index 6156ec8..0000000
--- a/debian/patches.Dansguardian_REMOVE-LATER/50_clamav095_support.dpatch
+++ /dev/null
@@ -1,171 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 50_clamav095_support.dpatch by Imre Gergely <gimre at narancs.net>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Adds support for clamav 0.95
-
- at 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
- }
diff --git a/debian/patches.Dansguardian_REMOVE-LATER/60_add_gcc4.4_support.dpatch b/debian/patches.Dansguardian_REMOVE-LATER/60_add_gcc4.4_support.dpatch
deleted file mode 100644
index a61a6e4..0000000
--- a/debian/patches.Dansguardian_REMOVE-LATER/60_add_gcc4.4_support.dpatch
+++ /dev/null
@@ -1,51 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 60_add_gcc4.4_support.dpatch by Martin Michlmayr <tbm at cyrius.com>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Adds support for gcc4.4 (#505386)
-
- at DPATCH@
-diff -urNad dansguardian-2.9.9.8~/src/contentscanners/clamav.cpp dansguardian-2.9.9.8/src/contentscanners/clamav.cpp
---- dansguardian-2.9.9.8~/src/contentscanners/clamav.cpp	2008-06-10 11:41:41.000000000 +0200
-+++ dansguardian-2.9.9.8/src/contentscanners/clamav.cpp	2009-06-14 11:28:16.000000000 +0200
-@@ -33,6 +33,7 @@
- #include <unistd.h>
- #include <clamav.h>
- #include <fcntl.h>
-+#include <cstdio>
- 
- 
- // GLOBALS
-diff -urNad dansguardian-2.9.9.8~/src/contentscanners/commandlinescan.cpp dansguardian-2.9.9.8/src/contentscanners/commandlinescan.cpp
---- dansguardian-2.9.9.8~/src/contentscanners/commandlinescan.cpp	2008-06-10 11:47:55.000000000 +0200
-+++ dansguardian-2.9.9.8/src/contentscanners/commandlinescan.cpp	2009-06-14 11:28:16.000000000 +0200
-@@ -35,6 +35,7 @@
- #include <sys/wait.h>
- #include <unistd.h>
- #include <list>
-+#include <cstdio>
- 
- 
- // GLOBALS
-diff -urNad dansguardian-2.9.9.8~/src/contentscanners/icapscan.cpp dansguardian-2.9.9.8/src/contentscanners/icapscan.cpp
---- dansguardian-2.9.9.8~/src/contentscanners/icapscan.cpp	2008-06-10 11:41:51.000000000 +0200
-+++ dansguardian-2.9.9.8/src/contentscanners/icapscan.cpp	2009-06-14 11:28:16.000000000 +0200
-@@ -36,6 +36,7 @@
- #include <fcntl.h>
- #include <unistd.h>
- #include <netdb.h>		// for gethostby
-+#include <cstdio>
- 
- 
- // DEFINES
-diff -urNad dansguardian-2.9.9.8~/src/downloadmanagers/fancy.cpp dansguardian-2.9.9.8/src/downloadmanagers/fancy.cpp
---- dansguardian-2.9.9.8~/src/downloadmanagers/fancy.cpp	2008-06-10 11:41:25.000000000 +0200
-+++ dansguardian-2.9.9.8/src/downloadmanagers/fancy.cpp	2009-06-14 11:28:16.000000000 +0200
-@@ -32,6 +32,7 @@
- #include <unistd.h>
- #include <iostream>
- #include <math.h>
-+#include <cstdio>
- 
- 
- // GLOBALS
diff --git a/debian/patches.Dansguardian_REMOVE-LATER/65-fix_clamdsocket.dpatch b/debian/patches.Dansguardian_REMOVE-LATER/65-fix_clamdsocket.dpatch
deleted file mode 100644
index 36c3a6b..0000000
--- a/debian/patches.Dansguardian_REMOVE-LATER/65-fix_clamdsocket.dpatch
+++ /dev/null
@@ -1,19 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 65-editconfig.dpatch by Alexander Wirt <formorer at debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Fix clamdsocket path
-
- at DPATCH@
-diff -urNad dansguardian-2.10.1.1~/configs/contentscanners/clamdscan.conf.in dansguardian-2.10.1.1/configs/contentscanners/clamdscan.conf.in
---- dansguardian-2.10.1.1~/configs/contentscanners/clamdscan.conf.in	2008-11-18 12:27:04.000000000 +0100
-+++ dansguardian-2.10.1.1/configs/contentscanners/clamdscan.conf.in	2010-02-13 20:33:07.000000000 +0100
-@@ -1,7 +1,7 @@
- plugname = 'clamdscan'
- 
- # edit this to match the location of your ClamD UNIX domain socket
--#clamdudsfile = '/var/run/clamav/clamd.sock'
-+clamdudsfile = '/var/run/clamav/clamd.ctl'
- 
- # If this string is set, the text it contains shall be removed from the
- # beginning of filenames when passing them to ClamD.
diff --git a/debian/patches.Dansguardian_REMOVE-LATER/70-gcc4.6.dpatch b/debian/patches.Dansguardian_REMOVE-LATER/70-gcc4.6.dpatch
deleted file mode 100644
index e9f533e..0000000
--- a/debian/patches.Dansguardian_REMOVE-LATER/70-gcc4.6.dpatch
+++ /dev/null
@@ -1,19 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 70-gcc4.6.dpatch by Daniel T Chen <crimsun at ubuntu.com>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Fix FTBFS by including cstddef for size_t
-
- at DPATCH@
-diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' dansguardian-2.10.1.1~/src/authplugins/ntlm.cpp dansguardian-2.10.1.1/src/authplugins/ntlm.cpp
---- dansguardian-2.10.1.1~/src/authplugins/ntlm.cpp	2008-11-18 06:27:04.000000000 -0500
-+++ dansguardian-2.10.1.1/src/authplugins/ntlm.cpp	2011-08-25 16:37:38.000000000 -0400
-@@ -27,6 +27,8 @@
- #include "../FDTunnel.hpp"
- #include "../OptionContainer.hpp"
- 
-+#include <cstddef>
-+
- #include <syslog.h>
- 
- #include <iconv.h>
diff --git a/debian/patches.Dansguardian_REMOVE-LATER/70_fix_clamav_detection b/debian/patches.Dansguardian_REMOVE-LATER/70_fix_clamav_detection
deleted file mode 100644
index 9df6b40..0000000
--- a/debian/patches.Dansguardian_REMOVE-LATER/70_fix_clamav_detection
+++ /dev/null
@@ -1,18 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 70_fix_clamav_datection.dpatch by Dan Chen <seven.steps at gmail.com>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Fix clamav detection in configure.ac
-
- at DPATCH@
---- dansguardian-2.10.1.1.orig/configure.ac
-+++ dansguardian-2.10.1.1/configure.ac
-@@ -333,7 +333,7 @@
- 	CLAMAVSHM="!! Not supported on this platform !!"
- else
- 	AC_MSG_RESULT(yes)
--	PKG_CHECK_MODULES([CLAMAV],[libclamav >= 4])
-+	PKG_CHECK_MODULES([CLAMAV],[libclamav >= 0.95])
- 
- 	AC_DEFINE([HAVE_CLAMAV],[],[Define to enable ClamAV content scanner])
- 	
diff --git a/debian/patches.Dansguardian_REMOVE-LATER/80_fix_libcre3_max_sub_expression_allocation.dpatch b/debian/patches.Dansguardian_REMOVE-LATER/80_fix_libcre3_max_sub_expression_allocation.dpatch
deleted file mode 100644
index 0f96c3a..0000000
--- a/debian/patches.Dansguardian_REMOVE-LATER/80_fix_libcre3_max_sub_expression_allocation.dpatch
+++ /dev/null
@@ -1,61 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 80_fix_libcre3_max_sub_expression_allocation.dpatch by Russell Coker
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: libpcre3 sets reg.re_nsub to an exreme large value and dansguardian
-## DP: tries to allocate memory for all records which lets malloc fail.
-## DP: this patch limits the allocation to 1024 records. (#667664)
-
- at DPATCH@
-diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' pkg-dansguardian~/src/RegExp.cpp pkg-dansguardian/src/RegExp.cpp
---- pkg-dansguardian~/src/RegExp.cpp	2011-10-29 14:16:31.000000000 +0200
-+++ pkg-dansguardian/src/RegExp.cpp	2012-06-23 11:02:48.821473711 +0200
-@@ -161,14 +161,17 @@
- 	offsets.clear();
- 	lengths.clear();
- 	imatched = false;
--	regmatch_t *pmatch = new regmatch_t[reg.re_nsub + 1];  // to hold result
-+	int num_sub_expressions = MAX_SUB_EXPRESSIONS;
-+	if(reg.re_nsub < num_sub_expressions)
-+		num_sub_expressions = reg.re_nsub;
-+	regmatch_t *pmatch = new regmatch_t[num_sub_expressions + 1];  // to hold result
- 	if (!pmatch) {  // if it failed
- 		delete[]pmatch;
- 		imatched = false;
- 		return false;
- 		// exception?
- 	}
--	if (regexec(&reg, pos, reg.re_nsub + 1, pmatch, 0)) {  // run regex
-+	if (regexec(&reg, pos, num_sub_expressions + 1, pmatch, 0)) {  // run regex
- 		delete[]pmatch;
- 		imatched = false;
- //        #ifdef DGDEBUG
-@@ -182,7 +185,7 @@
- 	int error = 0;
- 	while (error == 0) {
- 		largestoffset = 0;
--		for (i = 0; i <= (signed) reg.re_nsub; i++) {
-+		for (i = 0; i <= (signed) num_sub_expressions; i++) {
- 			if (pmatch[i].rm_so != -1) {
- 				matchlen = pmatch[i].rm_eo - pmatch[i].rm_so;
- 				submatch = new char[matchlen + 1];
-@@ -199,7 +202,7 @@
- 		}
- 		if (largestoffset > 0) {
- 			pos += largestoffset;
--			error = regexec(&reg, pos, reg.re_nsub + 1, pmatch, REG_NOTBOL);
-+			error = regexec(&reg, pos, num_sub_expressions + 1, pmatch, REG_NOTBOL);
- 		} else {
- 			error = -1;
- 		}
-diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' pkg-dansguardian~/src/RegExp.hpp pkg-dansguardian/src/RegExp.hpp
---- pkg-dansguardian~/src/RegExp.hpp	2011-10-29 14:16:31.000000000 +0200
-+++ pkg-dansguardian/src/RegExp.hpp	2012-06-23 11:02:48.821473711 +0200
-@@ -22,6 +22,7 @@
- #ifndef __HPP_REGEXP
- #define __HPP_REGEXP
- 
-+#define MAX_SUB_EXPRESSIONS 1024
- 
- // INCLUDES
- 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/e2guardian.git



More information about the debian-edu-commits mailing list