[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6156-g094ec9b
Török Edvin
edwin at clamav.net
Sun Apr 4 01:11:54 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit d0934caf993fe616b679e416aa3c336d52660e71
Author: Török Edvin <edwin at clamav.net>
Date: Fri Dec 11 20:43:58 2009 +0200
Distcheck fixes.
diff --git a/clambc/bcrun.c b/clambc/bcrun.c
index 596788e..e7fb63e 100644
--- a/clambc/bcrun.c
+++ b/clambc/bcrun.c
@@ -130,10 +130,11 @@ int main(int argc, char *argv[])
exit(1);
}
if(optget(opts, "version")->enabled) {
- char* argvx[] = {argv[0], "--version",NULL};
+ char versions[] = "--version";
+ char* argvx[] = {argv[0], versions,NULL};
printf("Clam AntiVirus Bytecode Testing Tool %s\n", get_version());
cl_init(CL_INIT_DEFAULT);
- cli_bytecode_debug(2, argvx);
+ cli_bytecode_printversion();
optfree(opts);
exit(0);
}
diff --git a/libclamav/Makefile.am b/libclamav/Makefile.am
index c846f50..b7e425e 100644
--- a/libclamav/Makefile.am
+++ b/libclamav/Makefile.am
@@ -181,6 +181,7 @@ libclamav_la_SOURCES = \
pe_icons.h \
disasm.c \
disasm.h \
+ disasm-common.h \
disasmpriv.h \
upx.c \
upx.h \
diff --git a/libclamav/Makefile.in b/libclamav/Makefile.in
index 4a428cf..417f720 100644
--- a/libclamav/Makefile.in
+++ b/libclamav/Makefile.in
@@ -119,28 +119,29 @@ am__libclamav_la_SOURCES_DIST = clamav.h matcher-ac.c matcher-ac.h \
mbox.h message.c message.h table.c table.h text.c text.h \
ole2_extract.c ole2_extract.h vba_extract.c vba_extract.h \
cltypes.h msexpand.c msexpand.h pe.c pe.h pe_icons.c \
- pe_icons.h disasm.c disasm.h disasmpriv.h upx.c upx.h \
- htmlnorm.c htmlnorm.h chmunpack.c chmunpack.h rebuildpe.c \
- rebuildpe.h petite.c petite.h wwunpack.c wwunpack.h unsp.c \
- unsp.h aspack.c aspack.h packlibs.c packlibs.h fsg.c fsg.h \
- mew.c mew.h upack.c upack.h line.c line.h untar.c untar.h \
- unzip.c unzip.h inflate64.c inflate64.h inffixed64.h \
- inflate64_priv.h special.c special.h binhex.c binhex.h \
- is_tar.c is_tar.h tnef.c tnef.h autoit.c autoit.h unarj.c \
- unarj.h nsis/bzlib.c nsis/bzlib_private.h nsis/nsis_bzlib.h \
- nsis/nulsft.c nsis/nulsft.h nsis/infblock.c nsis/nsis_zconf.h \
- nsis/nsis_zlib.h nsis/nsis_zutil.h pdf.c pdf.h spin.c spin.h \
- yc.c yc.h elf.c elf.h execs.h sis.c sis.h uuencode.c \
- uuencode.h phishcheck.c phishcheck.h phish_domaincheck_db.c \
- phish_domaincheck_db.h phish_whitelist.c phish_whitelist.h \
- iana_cctld.h iana_tld.h regex_list.c regex_list.h \
- regex_suffix.c regex_suffix.h mspack.c mspack.h cab.c cab.h \
- entconv.c entconv.h entitylist.h encoding_aliases.h hashtab.c \
- hashtab.h dconf.c dconf.h 7z/LzmaDec.c 7z/LzmaDec.h 7z/Types.h \
- lzma_iface.c lzma_iface.h 7z.c 7z.h 7z/7zFile.c 7z/7zFile.h \
- 7z/7zStream.c 7z/CpuArch.h 7z/7zCrc.c 7z/7zCrc.h 7z/7zBuf.c \
- 7z/7zBuf.h 7z/Bcj2.c 7z/Bcj2.h 7z/Bra.c 7z/Bra.h 7z/Bra86.c \
- 7z/BraIA64.c 7z/Archive/7z/7zIn.c 7z/Archive/7z/7zIn.h \
+ pe_icons.h disasm.c disasm.h disasm-common.h disasmpriv.h \
+ upx.c upx.h htmlnorm.c htmlnorm.h chmunpack.c chmunpack.h \
+ rebuildpe.c rebuildpe.h petite.c petite.h wwunpack.c \
+ wwunpack.h unsp.c unsp.h aspack.c aspack.h packlibs.c \
+ packlibs.h fsg.c fsg.h mew.c mew.h upack.c upack.h line.c \
+ line.h untar.c untar.h unzip.c unzip.h inflate64.c inflate64.h \
+ inffixed64.h inflate64_priv.h special.c special.h binhex.c \
+ binhex.h is_tar.c is_tar.h tnef.c tnef.h autoit.c autoit.h \
+ unarj.c unarj.h nsis/bzlib.c nsis/bzlib_private.h \
+ nsis/nsis_bzlib.h nsis/nulsft.c nsis/nulsft.h nsis/infblock.c \
+ nsis/nsis_zconf.h nsis/nsis_zlib.h nsis/nsis_zutil.h pdf.c \
+ pdf.h spin.c spin.h yc.c yc.h elf.c elf.h execs.h sis.c sis.h \
+ uuencode.c uuencode.h phishcheck.c phishcheck.h \
+ phish_domaincheck_db.c phish_domaincheck_db.h \
+ phish_whitelist.c phish_whitelist.h iana_cctld.h iana_tld.h \
+ regex_list.c regex_list.h regex_suffix.c regex_suffix.h \
+ mspack.c mspack.h cab.c cab.h entconv.c entconv.h entitylist.h \
+ encoding_aliases.h hashtab.c hashtab.h dconf.c dconf.h \
+ 7z/LzmaDec.c 7z/LzmaDec.h 7z/Types.h lzma_iface.c lzma_iface.h \
+ 7z.c 7z.h 7z/7zFile.c 7z/7zFile.h 7z/7zStream.c 7z/CpuArch.h \
+ 7z/7zCrc.c 7z/7zCrc.h 7z/7zBuf.c 7z/7zBuf.h 7z/Bcj2.c \
+ 7z/Bcj2.h 7z/Bra.c 7z/Bra.h 7z/Bra86.c 7z/BraIA64.c \
+ 7z/Archive/7z/7zIn.c 7z/Archive/7z/7zIn.h \
7z/Archive/7z/7zDecode.c 7z/Archive/7z/7zDecode.h \
7z/Archive/7z/7zItem.c 7z/Archive/7z/7zItem.h \
7z/Archive/7z/7zHeader.c 7z/Archive/7z/7zHeader.h \
@@ -614,15 +615,15 @@ libclamav_la_SOURCES = clamav.h matcher-ac.c matcher-ac.h matcher-bm.c \
rtf.c rtf.h blob.c blob.h mbox.c mbox.h message.c message.h \
table.c table.h text.c text.h ole2_extract.c ole2_extract.h \
vba_extract.c vba_extract.h cltypes.h msexpand.c msexpand.h \
- pe.c pe.h pe_icons.c pe_icons.h disasm.c disasm.h disasmpriv.h \
- upx.c upx.h htmlnorm.c htmlnorm.h chmunpack.c chmunpack.h \
- rebuildpe.c rebuildpe.h petite.c petite.h wwunpack.c \
- wwunpack.h unsp.c unsp.h aspack.c aspack.h packlibs.c \
- packlibs.h fsg.c fsg.h mew.c mew.h upack.c upack.h line.c \
- line.h untar.c untar.h unzip.c unzip.h inflate64.c inflate64.h \
- inffixed64.h inflate64_priv.h special.c special.h binhex.c \
- binhex.h is_tar.c is_tar.h tnef.c tnef.h autoit.c autoit.h \
- unarj.c unarj.h nsis/bzlib.c nsis/bzlib_private.h \
+ pe.c pe.h pe_icons.c pe_icons.h disasm.c disasm.h \
+ disasm-common.h disasmpriv.h upx.c upx.h htmlnorm.c htmlnorm.h \
+ chmunpack.c chmunpack.h rebuildpe.c rebuildpe.h petite.c \
+ petite.h wwunpack.c wwunpack.h unsp.c unsp.h aspack.c aspack.h \
+ packlibs.c packlibs.h fsg.c fsg.h mew.c mew.h upack.c upack.h \
+ line.c line.h untar.c untar.h unzip.c unzip.h inflate64.c \
+ inflate64.h inffixed64.h inflate64_priv.h special.c special.h \
+ binhex.c binhex.h is_tar.c is_tar.h tnef.c tnef.h autoit.c \
+ autoit.h unarj.c unarj.h nsis/bzlib.c nsis/bzlib_private.h \
nsis/nsis_bzlib.h nsis/nulsft.c nsis/nulsft.h nsis/infblock.c \
nsis/nsis_zconf.h nsis/nsis_zlib.h nsis/nsis_zutil.h pdf.c \
pdf.h spin.c spin.h yc.c yc.h elf.c elf.h execs.h sis.c sis.h \
diff --git a/libclamav/bytecode.c b/libclamav/bytecode.c
index 44e02dd..65d3b32 100644
--- a/libclamav/bytecode.c
+++ b/libclamav/bytecode.c
@@ -30,6 +30,7 @@
#include "bytecode.h"
#include "bytecode_priv.h"
#include "readdb.h"
+#include "scanners.h"
#include <string.h>
/* TODO: we should make sure lsigcnt is never NULL, and has at least as many
@@ -82,7 +83,7 @@ int cli_bytecode_context_getresult_file(struct cli_bc_ctx *ctx, char **tempfilen
}
/* resets bytecode state, so you can run another bytecode with same ctx */
-int cli_bytecode_context_reset(struct cli_bc_ctx *ctx)
+static int cli_bytecode_context_reset(struct cli_bc_ctx *ctx)
{
free(ctx->opsizes);
free(ctx->values);
@@ -94,7 +95,8 @@ int cli_bytecode_context_reset(struct cli_bc_ctx *ctx)
if (ctx->outfd != -1) {
cli_dbgmsg("Bytecode: nobody cared about FD %d, %s\n", ctx->outfd,
ctx->tempfile);
- ftruncate(ctx->outfd, 0);
+ if (ftruncate(ctx->outfd, 0) == -1)
+ cli_dbgmsg("ftruncate failed\n");
close(ctx->outfd);
cli_unlink(ctx->tempfile);
free(ctx->tempfile);
@@ -1579,7 +1581,6 @@ int cli_bytecode_done(struct cli_all_bc *allbc)
int cli_bytecode_context_setfile(struct cli_bc_ctx *ctx, fmap_t *map)
{
- struct stat buf;
ctx->fmap = map;
ctx->file_size = map->len + map->offset;
return 0;
@@ -1654,7 +1655,8 @@ int cli_bytecode_runhook(const struct cl_engine *engine, struct cli_bc_ctx *ctx,
cli_dbgmsg("***** Scanning unpacked file ******\n");
ret = cli_magic_scandesc(fd, cctx);
if (!cctx || !cctx->engine->keeptmp)
- ftruncate(fd, 0);
+ if (ftruncate(fd, 0) == -1)
+ cli_dbgmsg("ftruncate failed\n");
close(fd);
if (!cctx || !cctx->engine->keeptmp) {
if (cli_unlink(tempfile))
diff --git a/libclamav/bytecode.h b/libclamav/bytecode.h
index 1f56651..43b48ef 100644
--- a/libclamav/bytecode.h
+++ b/libclamav/bytecode.h
@@ -110,6 +110,7 @@ extern "C" {
int bytecode_init(void);
/* Bytecode internal debug API */
void cli_bytecode_debug(int argc, char **argv);
+void cli_bytecode_printversion();
void cli_bytecode_debug_printsrc(const struct cli_bc_ctx *ctx);
typedef void (*bc_dbg_callback_trace)(struct cli_bc_ctx*, unsigned event);
diff --git a/libclamav/bytecode_api.c b/libclamav/bytecode_api.c
index 3c4cd62..cb5e630 100644
--- a/libclamav/bytecode_api.c
+++ b/libclamav/bytecode_api.c
@@ -97,6 +97,7 @@ uint32_t cli_bcapi_setvirusname(struct cli_bc_ctx* ctx, const uint8_t *name, uin
uint32_t cli_bcapi_disasm_x86(struct cli_bc_ctx *ctx, struct DISASM_RESULT *res, uint32_t len)
{
//TODO: call disasm_x86_wrap, which outputs a MARIO struct
+ return -1;
}
/* TODO: field in ctx, id of last bytecode that called magicscandesc, reset
@@ -129,7 +130,7 @@ int32_t cli_bcapi_write(struct cli_bc_ctx *ctx, uint8_t*data, int32_t len)
res = cli_writen(ctx->outfd, data, len);
if (res > 0) ctx->written += res;
if (res == -1)
- cli_dbgmsg("Bytecode API: write failed: %s\n", errno);
+ cli_dbgmsg("Bytecode API: write failed: %d\n", errno);
return res;
}
diff --git a/libclamav/bytecode_nojit.c b/libclamav/bytecode_nojit.c
index 1a944c5..ad99eee 100644
--- a/libclamav/bytecode_nojit.c
+++ b/libclamav/bytecode_nojit.c
@@ -20,6 +20,7 @@
* MA 02110-1301, USA.
*/
+#include <stdio.h>
#include <stdlib.h>
#include "cltypes.h"
#include "bytecode.h"
@@ -69,4 +70,7 @@ int bytecode_init(void)
void cli_bytecode_debug_printsrc(const struct cli_bc_ctx *ctx) {
// Empty
}
+void cli_bytecode_printversion() {
+ printf("LLVM not compiled in\n");
+}
int have_clamjit=0;
diff --git a/libclamav/c++/Makefile.am b/libclamav/c++/Makefile.am
index 72dd9f0..928a0c7 100644
--- a/libclamav/c++/Makefile.am
+++ b/libclamav/c++/Makefile.am
@@ -830,7 +830,8 @@ distclean-local:
rm -f llvm/mklib llvm/tools/Makefile llvm/tools/llvmc/llvm-config.in llvm/utils/Makefile
rm -f llvm/Makefile.common llvm/Makefile.config llvm/config.log llvm/unittests/Makefile
rm -f llvm/llvm.spec llvm/include/llvm/Config/AsmPrinters.def llvm/include/llvm/Config/config.h
- rm -f llvm/include/llvm/Support/DataTypes.h llvm/include/llvm/Config/Targets.def
+ rm -f llvm/include/llvm/Config/Disassemblers.def
+ rm -f llvm/include/llvm/System/DataTypes.h llvm/include/llvm/Config/Targets.def
rm -f llvm/tools/llvmc/plugins/Base/Base.td llvm/tools/llvm-config/llvm-config.in
rm -f llvm/include/llvm/Config/AsmParsers.def
diff --git a/libclamav/c++/Makefile.in b/libclamav/c++/Makefile.in
index 01078b3..329e7bc 100644
--- a/libclamav/c++/Makefile.in
+++ b/libclamav/c++/Makefile.in
@@ -6659,7 +6659,8 @@ distclean-local:
rm -f llvm/mklib llvm/tools/Makefile llvm/tools/llvmc/llvm-config.in llvm/utils/Makefile
rm -f llvm/Makefile.common llvm/Makefile.config llvm/config.log llvm/unittests/Makefile
rm -f llvm/llvm.spec llvm/include/llvm/Config/AsmPrinters.def llvm/include/llvm/Config/config.h
- rm -f llvm/include/llvm/Support/DataTypes.h llvm/include/llvm/Config/Targets.def
+ rm -f llvm/include/llvm/Config/Disassemblers.def
+ rm -f llvm/include/llvm/System/DataTypes.h llvm/include/llvm/Config/Targets.def
rm -f llvm/tools/llvmc/plugins/Base/Base.td llvm/tools/llvm-config/llvm-config.in
rm -f llvm/include/llvm/Config/AsmParsers.def
diff --git a/libclamav/c++/bytecode2llvm.cpp b/libclamav/c++/bytecode2llvm.cpp
index 4cd9d40..61c4301 100644
--- a/libclamav/c++/bytecode2llvm.cpp
+++ b/libclamav/c++/bytecode2llvm.cpp
@@ -1290,3 +1290,7 @@ void cli_bytecode_debug_printsrc(const struct cli_bc_ctx *ctx)
}
int have_clamjit=1;
+void cli_bytecode_printversion()
+{
+ cl::PrintVersionMessage();
+}
diff --git a/libclamav/libclamav.map b/libclamav/libclamav.map
index 48cfc49..898eb7a 100644
--- a/libclamav/libclamav.map
+++ b/libclamav/libclamav.map
@@ -168,6 +168,7 @@ CLAMAV_PRIVATE {
funmap;
cli_bytecode_context_set_trace;
cli_bytecode_debug_printsrc;
+ cli_bytecode_printversion;
local:
*;
};
diff --git a/libclamav/pe.c b/libclamav/pe.c
index b5d137f..7289287 100644
--- a/libclamav/pe.c
+++ b/libclamav/pe.c
@@ -2214,7 +2214,7 @@ int cli_scanpe(cli_ctx *ctx, unsigned int *icongrps1, unsigned int *icongrps2)
pedata.exe_info.section = exe_sections;
pedata.exe_info.nsections = nsections;
pedata.exe_info.ep = ep;
- pedata.exe_info.offset = offset;
+ pedata.exe_info.offset = 0;
pedata.file_hdr = &file_hdr;
pedata.opt32 = &pe_opt.opt32;
pedata.opt64 = &pe_opt.opt64;
--
Debian repository for ClamAV
More information about the Pkg-clamav-commits
mailing list