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.
0.96
Török Edvin 15 years ago
parent 4933f3449b
commit 65cc5979e4
  1. 2
      libclamav/cache.c
  2. 1
      libclamav/scanners.c

@ -655,6 +655,8 @@ void cache_add(unsigned char *md5, size_t size, cli_ctx *ctx) {
return;
level = (*ctx->fmap && (*ctx->fmap)->dont_cache_flag) ? ctx->recursion : 0;
if (ctx->found_possibly_unwanted && (level || !ctx->recursion))
return;
c = &ctx->engine->cache[key];
if(pthread_mutex_lock(&c->mutex)) {
cli_errmsg("cli_add: mutex lock fail\n");

@ -2356,6 +2356,7 @@ int cli_found_possibly_unwanted(cli_ctx* ctx)
} else {
cli_warnmsg("cli_found_possibly_unwanted called, but virname is not set\n");
}
emax_reached(ctx);
return CL_CLEAN;
}

Loading…
Cancel
Save