summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2010-09-03 11:27:22 +0000
committerRenato Botelho <garga@FreeBSD.org>2010-09-03 11:27:22 +0000
commit6458ba6ddbb9895fe44bd615147c350a91c9fcae (patch)
treecafc3a1d2d11f206ce0db7d906ff3d38856ebcd3 /security
parent- Bump PORTREVISION to chase the update of math/jlatexmath (diff)
- Fix bytecode problem on FreeBSD 7.1
- Bump PORTREVISION PR: ports/150243 Submitted by: Frank Wall <fw@moov.de> Obtained from: https://wwws.clamav.net/bugzilla/show_bug.cgi?id=2235
Notes
Notes: svn path=/head/; revision=260480
Diffstat (limited to 'security')
-rw-r--r--security/clamav/Makefile2
-rw-r--r--security/clamav/files/patch-libclamav__bytecode.c12
-rw-r--r--security/clamav/files/patch-libclamav__c++__bytecode2llvm.cpp34
3 files changed, 47 insertions, 1 deletions
diff --git a/security/clamav/Makefile b/security/clamav/Makefile
index 4ba6cfd6340a..54b9e9ccfc30 100644
--- a/security/clamav/Makefile
+++ b/security/clamav/Makefile
@@ -7,7 +7,7 @@
PORTNAME= clamav
DISTVERSION= 0.96.2
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= security
MASTER_SITES= SF
diff --git a/security/clamav/files/patch-libclamav__bytecode.c b/security/clamav/files/patch-libclamav__bytecode.c
new file mode 100644
index 000000000000..24d75389f83f
--- /dev/null
+++ b/security/clamav/files/patch-libclamav__bytecode.c
@@ -0,0 +1,12 @@
+--- libclamav/bytecode.c
++++ libclamav/bytecode.c
+@@ -2107,6 +2107,7 @@ static int run_selfcheck(struct cli_all_bc *bcs)
+ cli_bytecode_context_setfuncid(ctx, bc, 0);
+
+ cli_dbgmsg("bytecode self test running\n");
++ ctx->bytecode_timeout = 0;
+ rc = cli_bytecode_run(bcs, bc, ctx);
+ cli_bytecode_context_destroy(ctx);
+ if (rc != CL_SUCCESS) {
+diff --git a/libclamav/c++/bytecode2llvm.cpp b/libclamav/c++/bytecode2llvm.cpp
+index 0f1de1a..f0b12fe 100644
diff --git a/security/clamav/files/patch-libclamav__c++__bytecode2llvm.cpp b/security/clamav/files/patch-libclamav__c++__bytecode2llvm.cpp
new file mode 100644
index 000000000000..3c3581919b53
--- /dev/null
+++ b/security/clamav/files/patch-libclamav__c++__bytecode2llvm.cpp
@@ -0,0 +1,34 @@
+--- libclamav/c++/bytecode2llvm.cpp
++++ libclamav/c++/bytecode2llvm.cpp
+@@ -1637,11 +1637,15 @@ int cli_vm_execute_jit(const struct cli_all_bc *bcs, struct cli_bc_ctx *ctx,
+ 0
+ };
+
+- if ((ret = pthread_create(&thread, NULL, bytecode_watchdog, &w))) {
+- errs() << "Bytecode: failed to create new thread!";
+- errs() << cli_strerror(ret, buf, sizeof(buf));
+- errs() << "\n";
+- return CL_EBYTECODE;
++ if (ctx->bytecode_timeout) {
++ /* only spawn if timeout is set.
++ * we don't set timeout for selfcheck (see bb #2235) */
++ if ((ret = pthread_create(&thread, NULL, bytecode_watchdog, &w))) {
++ errs() << "Bytecode: failed to create new thread!";
++ errs() << cli_strerror(ret, buf, sizeof(buf));
++ errs() << "\n";
++ return CL_EBYTECODE;
++ }
+ }
+
+ ret = bytecode_execute((intptr_t)code, ctx);
+@@ -1649,7 +1653,9 @@ int cli_vm_execute_jit(const struct cli_all_bc *bcs, struct cli_bc_ctx *ctx,
+ w.finished = 1;
+ pthread_cond_signal(&w.cond);
+ pthread_mutex_unlock(&w.mutex);
+- pthread_join(thread, NULL);
++ if (ctx->bytecode_timeout) {
++ pthread_join(thread, NULL);
++ }
+
+ if (cli_debug_flag) {
+ gettimeofday(&tv1, NULL);