[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6156-g094ec9b

aCaB acab at clamav.net
Sun Apr 4 01:14:01 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit 54e6b31f1a93dc7846f9b2c30ef04d5f9c3b0240
Author: aCaB <acab at clamav.net>
Date:   Tue Jan 5 15:27:36 2010 +0100

    cache fixes

diff --git a/clamd/clamd.c b/clamd/clamd.c
index 50c8c92..d398269 100644
--- a/clamd/clamd.c
+++ b/clamd/clamd.c
@@ -306,7 +306,7 @@ int main(int argc, char **argv)
 	break;
     }
 
-    cache_init(256);
+    cl_cache_init(256);
 
     if(!(engine = cl_engine_new())) {
 	logg("!Can't initialize antivirus engine\n");
diff --git a/clamscan/clamscan.c b/clamscan/clamscan.c
index 68f58e9..9808527 100644
--- a/clamscan/clamscan.c
+++ b/clamscan/clamscan.c
@@ -144,7 +144,7 @@ int main(int argc, char **argv)
 
     gettimeofday(&t1, NULL);
 
-    cache_init(256);
+    cl_cache_init(256);
 
     ret = scanmanager(opts);
 
diff --git a/libclamav/Makefile.am b/libclamav/Makefile.am
index 420a04d..3cea192 100644
--- a/libclamav/Makefile.am
+++ b/libclamav/Makefile.am
@@ -345,7 +345,7 @@ libclamav_la_SOURCES = \
 	bytecode_api_decl.c \
 	bytecode_api.h \
 	bytecode_api_impl.h \
-	bytecode_hooks.h
+	bytecode_hooks.h \
 	cache.c \
 	cache.h
 
diff --git a/libclamav/Makefile.in b/libclamav/Makefile.in
index 5448ed3..1de2617 100644
--- a/libclamav/Makefile.in
+++ b/libclamav/Makefile.in
@@ -153,7 +153,8 @@ am__libclamav_la_SOURCES_DIST = clamav.h matcher-ac.c matcher-ac.h \
 	bytecode_vm.c bytecode_priv.h clambc.h cpio.c cpio.h macho.c \
 	macho.h ishield.c ishield.h type_desc.h bcfeatures.h \
 	bytecode_api.c bytecode_api_decl.c bytecode_api.h \
-	bytecode_api_impl.h bytecode_hooks.h bignum.c bignum_class.h
+	bytecode_api_impl.h bytecode_hooks.h cache.c cache.h bignum.c \
+	bignum_class.h
 @LINK_TOMMATH_FALSE at am__objects_1 = libclamav_la-bignum.lo
 am_libclamav_la_OBJECTS = libclamav_la-matcher-ac.lo \
 	libclamav_la-matcher-bm.lo libclamav_la-matcher.lo \
@@ -202,7 +203,8 @@ am_libclamav_la_OBJECTS = libclamav_la-matcher-ac.lo \
 	libclamav_la-bytecode.lo libclamav_la-bytecode_vm.lo \
 	libclamav_la-cpio.lo libclamav_la-macho.lo \
 	libclamav_la-ishield.lo libclamav_la-bytecode_api.lo \
-	libclamav_la-bytecode_api_decl.lo $(am__objects_1)
+	libclamav_la-bytecode_api_decl.lo libclamav_la-cache.lo \
+	$(am__objects_1)
 libclamav_la_OBJECTS = $(am_libclamav_la_OBJECTS)
 AM_V_lt = $(am__v_lt_$(V))
 am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
@@ -649,7 +651,8 @@ libclamav_la_SOURCES = clamav.h matcher-ac.c matcher-ac.h matcher-bm.c \
 	bytecode_vm.c bytecode_priv.h clambc.h cpio.c cpio.h macho.c \
 	macho.h ishield.c ishield.h type_desc.h bcfeatures.h \
 	bytecode_api.c bytecode_api_decl.c bytecode_api.h \
-	bytecode_api_impl.h bytecode_hooks.h $(am__append_7)
+	bytecode_api_impl.h bytecode_hooks.h cache.c cache.h \
+	$(am__append_7)
 noinst_LTLIBRARIES = libclamav_internal_utils.la libclamav_internal_utils_nothreads.la libclamav_nocxx.la
 COMMON_CLEANFILES = version.h version.h.tmp *.gcda *.gcno
 @MAINTAINER_MODE_TRUE at BUILT_SOURCES = jsparse/generated/operators.h jsparse/generated/keywords.h jsparse-keywords.gperf
@@ -795,6 +798,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libclamav_la-bytecode_vm.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libclamav_la-bzlib.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libclamav_la-cab.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libclamav_la-cache.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libclamav_la-chmunpack.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libclamav_la-cpio.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libclamav_la-cvd.Plo at am__quote@
@@ -1659,6 +1663,14 @@ libclamav_la-bytecode_api_decl.lo: bytecode_api_decl.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libclamav_la_CFLAGS) $(CFLAGS) -c -o libclamav_la-bytecode_api_decl.lo `test -f 'bytecode_api_decl.c' || echo '$(srcdir)/'`bytecode_api_decl.c
 
+libclamav_la-cache.lo: cache.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libclamav_la_CFLAGS) $(CFLAGS) -MT libclamav_la-cache.lo -MD -MP -MF $(DEPDIR)/libclamav_la-cache.Tpo -c -o libclamav_la-cache.lo `test -f 'cache.c' || echo '$(srcdir)/'`cache.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libclamav_la-cache.Tpo $(DEPDIR)/libclamav_la-cache.Plo
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='cache.c' object='libclamav_la-cache.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libclamav_la_CFLAGS) $(CFLAGS) -c -o libclamav_la-cache.lo `test -f 'cache.c' || echo '$(srcdir)/'`cache.c
+
 libclamav_la-bignum.lo: bignum.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libclamav_la_CFLAGS) $(CFLAGS) -MT libclamav_la-bignum.lo -MD -MP -MF $(DEPDIR)/libclamav_la-bignum.Tpo -c -o libclamav_la-bignum.lo `test -f 'bignum.c' || echo '$(srcdir)/'`bignum.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libclamav_la-bignum.Tpo $(DEPDIR)/libclamav_la-bignum.Plo
@@ -2231,8 +2243,6 @@ uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
 	tags tags-recursive uninstall uninstall-am \
 	uninstall-includeHEADERS uninstall-libLTLIBRARIES
 
-	cache.c \
-	cache.h
 
 .PHONY: version.h.tmp
 version.c: version.h
diff --git a/libclamav/cache.c b/libclamav/cache.c
index b8951b6..ba53d74 100644
--- a/libclamav/cache.c
+++ b/libclamav/cache.c
@@ -165,7 +165,7 @@ void cache_add(unsigned char *md5, cli_ctx *ctx) {
 
 int cache_check(unsigned char *hash, cli_ctx *ctx) {
     fmap_t *map = *ctx->fmap;
-    size_t todo = map->len, at = 0;;
+    size_t todo = map->len, at = 0;
     cli_md5_ctx md5;
 
     if(!cache) return CL_VIRUS;
@@ -174,10 +174,8 @@ int cache_check(unsigned char *hash, cli_ctx *ctx) {
     while(todo) {
 	void *buf;
 	size_t readme = todo < FILEBUFF ? todo : FILEBUFF;
-	if(!(buf = fmap_need_off_once(map, at, readme)) != readme) {
-	    lseek(desc, seekback, SEEK_SET);
+	if(!(buf = fmap_need_off_once(map, at, readme)))
 	    return CL_VIRUS;
-	}
 	todo -= readme;
 	at += readme;
 	cli_md5_update(&md5, buf, readme);
diff --git a/libclamav/scanners.c b/libclamav/scanners.c
index 554fc98..4d8f05d 100644
--- a/libclamav/scanners.c
+++ b/libclamav/scanners.c
@@ -2169,7 +2169,7 @@ int cli_magic_scandesc(int desc, cli_ctx *ctx)
     ctx->fmap--;
 
     if(ret == CL_VIRUS)
-	return cli_checkfp(desc, ctx) ? CL_CLEAN : CL_VIRUS;
+	ret = cli_checkfp(desc, ctx) ? CL_CLEAN : CL_VIRUS;
 
     switch(ret) {
 	case CL_EFORMAT:
@@ -2177,10 +2177,10 @@ int cli_magic_scandesc(int desc, cli_ctx *ctx)
 	case CL_EMAXSIZE:
 	case CL_EMAXFILES:
 	    cli_dbgmsg("Descriptor[%d]: %s\n", desc, cl_strerror(ret));
+	case CL_CLEAN:
 	    cache_add(hash, ctx);
 	    return CL_CLEAN;
 	default:
-	    if(ret == CL_CLEAN) cache_add(hash, ctx);
 	    return ret;
     }
 }

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list