Browse code

Better fix for found_possibly_unwanted and caching.

We treat found_possibly_unwanted as EMAX, except we can't cache
these at all, not even at their own reclevel, and we certainly can't cache
level0 (since we know it'll be virus).
We are still caching siblings in an archive, as long as they don't hit emax
themselves.

Török Edvin authored on 2010/03/10 21:49:22
Showing 2 changed files
... ...
@@ -655,6 +655,8 @@ void cache_add(unsigned char *md5, size_t size, cli_ctx *ctx) {
655 655
        return;
656 656
 
657 657
     level =  (*ctx->fmap && (*ctx->fmap)->dont_cache_flag) ? ctx->recursion : 0;
658
+    if (ctx->found_possibly_unwanted && (level || !ctx->recursion))
659
+	return;
658 660
     c = &ctx->engine->cache[key];
659 661
     if(pthread_mutex_lock(&c->mutex)) {
660 662
 	cli_errmsg("cli_add: mutex lock fail\n");
... ...
@@ -2356,6 +2356,7 @@ int cli_found_possibly_unwanted(cli_ctx* ctx)
2356 2356
 	} else {
2357 2357
 		cli_warnmsg("cli_found_possibly_unwanted called, but virname is not set\n");
2358 2358
 	}
2359
+	emax_reached(ctx);
2359 2360
 	return CL_CLEAN;
2360 2361
 }
2361 2362