... | ... |
@@ -1,3 +1,9 @@ |
1 |
+Fri Sep 16 12:47:10 CEST 2011 (acab) |
|
2 |
+------------------------------------ |
|
3 |
+ * libclamav: properly pass custom flag to sigload_cb |
|
4 |
+ * c4w: honor custom sigs in mindefs |
|
5 |
+ (bb#3509 + bb#3510) |
|
6 |
+ |
|
1 | 7 |
Thu Sep 15 14:44:11 CEST 2011 (tk) |
2 | 8 |
---------------------------------- |
3 | 9 |
* freshclam: fix pidfile removal (bb#3499) |
... | ... |
@@ -573,7 +573,7 @@ static int cli_loaddb(FILE *fs, struct cl_engine *engine, unsigned int *signo, u |
573 | 573 |
if(engine->ignored && cli_chkign(engine->ignored, start, buffer_cpy)) |
574 | 574 |
continue; |
575 | 575 |
|
576 |
- if(engine->cb_sigload && engine->cb_sigload("db", start, options & CL_DB_OFFICIAL, engine->cb_sigload_ctx)) { |
|
576 |
+ if(engine->cb_sigload && engine->cb_sigload("db", start, ~options & CL_DB_OFFICIAL, engine->cb_sigload_ctx)) { |
|
577 | 577 |
cli_dbgmsg("cli_loaddb: skipping %s due to callback\n", start); |
578 | 578 |
continue; |
579 | 579 |
} |
... | ... |
@@ -652,7 +652,7 @@ static int cli_loadidb(FILE *fs, struct cl_engine *engine, unsigned int *signo, |
652 | 652 |
if(engine->ignored && cli_chkign(engine->ignored, tokens[0], buffer_cpy)) |
653 | 653 |
continue; |
654 | 654 |
|
655 |
- if(engine->cb_sigload && engine->cb_sigload("idb", tokens[0], options & CL_DB_OFFICIAL, engine->cb_sigload_ctx)) { |
|
655 |
+ if(engine->cb_sigload && engine->cb_sigload("idb", tokens[0], ~options & CL_DB_OFFICIAL, engine->cb_sigload_ctx)) { |
|
656 | 656 |
cli_dbgmsg("cli_loadidb: skipping %s due to callback\n", tokens[0]); |
657 | 657 |
continue; |
658 | 658 |
} |
... | ... |
@@ -926,7 +926,7 @@ static int cli_loadndb(FILE *fs, struct cl_engine *engine, unsigned int *signo, |
926 | 926 |
if(engine->ignored && cli_chkign(engine->ignored, virname, buffer_cpy)) |
927 | 927 |
continue; |
928 | 928 |
|
929 |
- if(!sdb && engine->cb_sigload && engine->cb_sigload("ndb", virname, options & CL_DB_OFFICIAL, engine->cb_sigload_ctx)) { |
|
929 |
+ if(!sdb && engine->cb_sigload && engine->cb_sigload("ndb", virname, ~options & CL_DB_OFFICIAL, engine->cb_sigload_ctx)) { |
|
930 | 930 |
cli_dbgmsg("cli_loadndb: skipping %s due to callback\n", virname); |
931 | 931 |
continue; |
932 | 932 |
} |
... | ... |
@@ -1235,7 +1235,7 @@ static int load_oneldb(char *buffer, int chkpua, int chkign, struct cl_engine *e |
1235 | 1235 |
if (chkign && cli_chkign(engine->ignored, virname, buffer_cpy)) |
1236 | 1236 |
return CL_SUCCESS; |
1237 | 1237 |
|
1238 |
- if(engine->cb_sigload && engine->cb_sigload("ldb", virname, options & CL_DB_OFFICIAL, engine->cb_sigload_ctx)) { |
|
1238 |
+ if(engine->cb_sigload && engine->cb_sigload("ldb", virname, ~options & CL_DB_OFFICIAL, engine->cb_sigload_ctx)) { |
|
1239 | 1239 |
cli_dbgmsg("cli_loadldb: skipping %s due to callback\n", virname); |
1240 | 1240 |
(*sigs)--; |
1241 | 1241 |
return CL_SUCCESS; |
... | ... |
@@ -1443,7 +1443,7 @@ static int cli_loadcbc(FILE *fs, struct cl_engine *engine, unsigned int *signo, |
1443 | 1443 |
return CL_SUCCESS; |
1444 | 1444 |
} |
1445 | 1445 |
|
1446 |
- if(engine->cb_sigload && engine->cb_sigload("cbc", dbname, options & CL_DB_OFFICIAL, engine->cb_sigload_ctx)) { |
|
1446 |
+ if(engine->cb_sigload && engine->cb_sigload("cbc", dbname, ~options & CL_DB_OFFICIAL, engine->cb_sigload_ctx)) { |
|
1447 | 1447 |
cli_dbgmsg("cli_loadcbc: skipping %s due to callback\n", dbname); |
1448 | 1448 |
return CL_SUCCESS; |
1449 | 1449 |
} |
... | ... |
@@ -1948,7 +1948,7 @@ static int cli_loadhash(FILE *fs, struct cl_engine *engine, unsigned int *signo, |
1948 | 1948 |
dot = dbname; |
1949 | 1949 |
else |
1950 | 1950 |
dot++; |
1951 |
- if(engine->cb_sigload(dot, pt, options & CL_DB_OFFICIAL, engine->cb_sigload_ctx)) { |
|
1951 |
+ if(engine->cb_sigload(dot, pt, ~options & CL_DB_OFFICIAL, engine->cb_sigload_ctx)) { |
|
1952 | 1952 |
cli_dbgmsg("cli_loadhash: skipping %s (%s) due to callback\n", pt, dot); |
1953 | 1953 |
continue; |
1954 | 1954 |
} |
... | ... |
@@ -2090,7 +2090,7 @@ static int cli_loadmd(FILE *fs, struct cl_engine *engine, unsigned int *signo, i |
2090 | 2090 |
continue; |
2091 | 2091 |
} |
2092 | 2092 |
|
2093 |
- if(engine->cb_sigload && engine->cb_sigload("md", new->virname, options & CL_DB_OFFICIAL, engine->cb_sigload_ctx)) { |
|
2093 |
+ if(engine->cb_sigload && engine->cb_sigload("md", new->virname, ~options & CL_DB_OFFICIAL, engine->cb_sigload_ctx)) { |
|
2094 | 2094 |
cli_dbgmsg("cli_loadmd: skipping %s due to callback\n", new->virname); |
2095 | 2095 |
mpool_free(engine->mempool, new->virname); |
2096 | 2096 |
mpool_free(engine->mempool, new); |
... | ... |
@@ -2230,7 +2230,7 @@ static int cli_loadcdb(FILE *fs, struct cl_engine *engine, unsigned int *signo, |
2230 | 2230 |
continue; |
2231 | 2231 |
} |
2232 | 2232 |
|
2233 |
- if(engine->cb_sigload && engine->cb_sigload("cdb", new->virname, options & CL_DB_OFFICIAL, engine->cb_sigload_ctx)) { |
|
2233 |
+ if(engine->cb_sigload && engine->cb_sigload("cdb", new->virname, ~options & CL_DB_OFFICIAL, engine->cb_sigload_ctx)) { |
|
2234 | 2234 |
cli_dbgmsg("cli_loadcdb: skipping %s due to callback\n", new->virname); |
2235 | 2235 |
mpool_free(engine->mempool, new->virname); |
2236 | 2236 |
mpool_free(engine->mempool, new); |
... | ... |
@@ -441,7 +441,7 @@ int load_regex_matcher(struct cl_engine *engine,struct regex_matcher* matcher,FI |
441 | 441 |
if(functionality_level_check(buffer)) |
442 | 442 |
continue; |
443 | 443 |
|
444 |
- if(engine->cb_sigload && engine->cb_sigload("phishing", buffer, options & CL_DB_OFFICIAL, engine->cb_sigload_ctx)) { |
|
444 |
+ if(engine->cb_sigload && engine->cb_sigload("phishing", buffer, ~options & CL_DB_OFFICIAL, engine->cb_sigload_ctx)) { |
|
445 | 445 |
cli_dbgmsg("load_regex_matcher: skipping %s due to callback\n", buffer); |
446 | 446 |
continue; |
447 | 447 |
} |
... | ... |
@@ -306,11 +306,14 @@ BOOL interface_setup(void) { |
306 | 306 |
} |
307 | 307 |
|
308 | 308 |
static int sigload_callback(const char *type, const char *name, unsigned int custom, void *context) { |
309 |
- if(minimal_definitions && (custom || strcmp(type, "fp"))) |
|
309 |
+ logg("*in Sigload_cb(%s, %s, %u, %p) - MinDef:%u, Off: %u, Cust: %u\n", type, name, custom, context, minimal_definitions, official_sigs, custom_sigs); |
|
310 |
+ if(!strcmp(type, "fp")) |
|
311 |
+ return 0; |
|
312 |
+ if(minimal_definitions && !custom) |
|
310 | 313 |
return 1; |
311 | 314 |
if(custom) |
312 | 315 |
custom_sigs++; |
313 |
- else if(strcmp(type, "fp")) |
|
316 |
+ else |
|
314 | 317 |
official_sigs++; |
315 | 318 |
return 0; |
316 | 319 |
} |
... | ... |
@@ -392,11 +395,12 @@ static int load_db(void) { |
392 | 392 |
int CLAMAPI Scan_HaveSigs(unsigned int *official, unsigned int *custom) { |
393 | 393 |
int ret; |
394 | 394 |
if(lock_engine()) |
395 |
- FAIL(-1, "failed to lock engine"); |
|
395 |
+ FAIL(CL_ELOCK, "failed to lock engine"); |
|
396 | 396 |
if(!engine) { |
397 | 397 |
unlock_engine(); |
398 |
- FAIL(-1, "No engine available"); |
|
398 |
+ FAIL(CL_ESTATE, "Engine unavailable"); |
|
399 | 399 |
} |
400 |
+ logg("*in HaveSigs - Off: %u, Cst: %u\n", official_sigs, custom_sigs); |
|
400 | 401 |
ret = ((official_sigs + custom_sigs) > 0); |
401 | 402 |
if(official) *official = official_sigs; |
402 | 403 |
if(custom) *custom = custom_sigs; |