Merge branch 'master' of git.clam.sourcefire.com:/var/lib/git/clamav-devel

pull/6/head
Kevin Lin 11 years ago
commit 252a31c587
  1. 2
      freshclam/freshclam.c
  2. 19
      libclamav/scanners.c
  3. 8
      libclamav/unzip.c

@ -759,6 +759,8 @@ void submit_host_info(struct optstruct *opts)
if (!(engine))
return;
cl_engine_stats_enable(engine);
intel = engine->stats_data;
if (!(intel)) {
engine->cb_stats_submit = NULL;

@ -2597,12 +2597,21 @@ static int magic_scandesc(cli_ctx *ctx, cli_file_t type)
json_object *arrobj, *ftobj, *fsobj;
if (NULL == ctx->properties) {
ctx->properties = json_object_new_object();
if (NULL == ctx->properties) {
cli_errmsg("magic_scandesc: no memory for json properties object\n");
early_ret_from_magicscan(CL_EMEM);
if (type == CL_TYPE_PDF || /* file types we collect properties about */
type == CL_TYPE_MSOLE2 ||
type == CL_TYPE_MSEXE ||
type == CL_TYPE_OOXML_WORD ||
type == CL_TYPE_OOXML_PPT ||
type == CL_TYPE_OOXML_XL) {
ctx->properties = json_object_new_object();
if (NULL == ctx->properties) {
cli_errmsg("magic_scandesc: no memory for json properties object\n");
early_ret_from_magicscan(CL_EMEM);
}
ctx->wrkproperty = ctx->properties;
} else { /* turn off property collection flag for file types we don't care about */
ctx->options &= ~CL_SCAN_FILE_PROPERTIES;
}
ctx->wrkproperty = ctx->properties;
}
else {
parent_property = ctx->wrkproperty;

@ -500,6 +500,7 @@ int cli_unzip(cli_ctx *ctx) {
fmap_t *map = *ctx->fmap;
char *tmpd;
const char *ptr;
int virus_found = 0;
cli_dbgmsg("in cli_unzip\n");
fsize = (uint32_t)map->len;
@ -546,6 +547,10 @@ int cli_unzip(cli_ctx *ctx) {
while (ret==CL_CLEAN && lhoff<fsize && (coff=lhdr(map, lhoff, fsize-lhoff, &fu, fc+1, NULL, &ret, ctx, tmpd, 1, zip_scan_cb))) {
fc++;
lhoff+=coff;
if (SCAN_ALL && ret == CL_VIRUS) {
ret = CL_CLEAN;
virus_found = 1;
}
if (ctx->engine->maxfiles && fu>=ctx->engine->maxfiles) {
cli_dbgmsg("cli_unzip: Files limit reached (max: %u)\n", ctx->engine->maxfiles);
ret=CL_EMAXFILES;
@ -556,6 +561,9 @@ int cli_unzip(cli_ctx *ctx) {
if (!ctx->engine->keeptmp) cli_rmdirs(tmpd);
free(tmpd);
if (ret == CL_CLEAN && virus_found)
ret = CL_VIRUS;
return ret;
}

Loading…
Cancel
Save