diff options
author | garga <garga@FreeBSD.org> | 2010-09-03 19:27:22 +0800 |
---|---|---|
committer | garga <garga@FreeBSD.org> | 2010-09-03 19:27:22 +0800 |
commit | 681d78f2016735dfbc6dee646b5e6b90bd4235eb (patch) | |
tree | 15c60a8815d39330aa5e284dbe265a61bdd8ad2c | |
parent | 1c8782d0d32d56ea1fd7555be05a6608e4e3fe8b (diff) | |
download | freebsd-ports-gnome-681d78f2016735dfbc6dee646b5e6b90bd4235eb.tar.gz freebsd-ports-gnome-681d78f2016735dfbc6dee646b5e6b90bd4235eb.tar.zst freebsd-ports-gnome-681d78f2016735dfbc6dee646b5e6b90bd4235eb.zip |
- 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
-rw-r--r-- | security/clamav/Makefile | 2 | ||||
-rw-r--r-- | security/clamav/files/patch-libclamav__bytecode.c | 12 | ||||
-rw-r--r-- | security/clamav/files/patch-libclamav__c++__bytecode2llvm.cpp | 34 |
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); |