remove CL_EXPERIMENTAL wrappers from calls to phishcheck/entcoonv.

replace them with DCONF checks.


git-svn-id: file:///var/lib/svn/clamav-devel/branches/temp_dconf_phishenable@2982 77e5149b-7576-45b1-b177-96237e5ba77b
remotes/push_mirror/metadata
Török Edvin 18 years ago
parent ec30bb298f
commit 4890cb614e
  1. 6
      libclamav/filetypes.c
  2. 27
      libclamav/readdb.c

@ -38,10 +38,8 @@
#include "matcher-ac.h"
#include "str.h"
#ifdef CL_EXPERIMENTAL
#include "htmlnorm.h"
#include "entconv.h"
#endif
struct cli_magic_s {
size_t offset;
@ -288,8 +286,7 @@ cli_file_t cli_filetype2(int desc, const struct cl_engine *engine)
}
cli_ac_freedata(&mdata);
#ifdef CL_EXPERIMENTAL
if(ret != CL_TYPE_HTML_UTF16) {
if(((struct cli_dconf*) engine->dconf)->phishing&PHISHING_CONF_ENTCONV && ret != CL_TYPE_HTML_UTF16) {
struct entity_conv conv;
const size_t conv_size = 2*bread < 256 ? 256 : 2*bread;
@ -325,7 +322,6 @@ cli_file_t cli_filetype2(int desc, const struct cl_engine *engine)
cli_warnmsg("cli_filetype2: Error initializing entity converter\n");
}
}
#endif /* CL_EXPERIMENTAL */
}
}

@ -56,12 +56,10 @@
#include "lockdb.h"
#include "readdb.h"
#ifdef CL_EXPERIMENTAL
#include "phishcheck.h"
#include "phish_whitelist.h"
#include "phish_domaincheck_db.h"
#include "regex_list.h"
#endif
#if defined(HAVE_READDIR_R_3) || defined(HAVE_READDIR_R_2)
#include <limits.h>
@ -504,9 +502,7 @@ int cli_parse_add(struct cli_matcher *root, const char *virname, const char *hex
int cli_initengine(struct cl_engine **engine, unsigned int options)
{
#ifdef CL_EXPERIMENTAL
int ret;
#endif
if(!*engine) {
@ -538,11 +534,9 @@ int cli_initengine(struct cl_engine **engine, unsigned int options)
}
}
#ifdef CL_EXPERIMENTAL
if(options & CL_DB_PHISHING_URLS)
if(options & CL_DB_PHISHING_URLS && ((struct cli_dconf*) (*engine)->dconf)->phishing&PHISHING_CONF_ENGINE)
if((ret = phishing_init(*engine)))
return ret;
#endif
return CL_SUCCESS;
}
@ -648,7 +642,6 @@ static int cli_loaddb(FILE *fd, struct cl_engine **engine, unsigned int *signo,
return CL_SUCCESS;
}
#ifdef CL_EXPERIMENTAL
static int cli_loadwdb(FILE *fd, struct cl_engine **engine, unsigned int options)
{
int ret = 0;
@ -659,6 +652,9 @@ static int cli_loadwdb(FILE *fd, struct cl_engine **engine, unsigned int options
return ret;
}
if(! ((struct cli_dconf*) (*engine)->dconf)->phishing&PHISHING_CONF_ENGINE)
return CL_SUCCESS;
if(!(*engine)->whitelist_matcher) {
if((ret = init_whitelist(*engine))) {
phishing_done(*engine);
@ -686,6 +682,9 @@ static int cli_loadpdb(FILE *fd, struct cl_engine **engine, unsigned int options
return ret;
}
if(! ((struct cli_dconf*) (*engine)->dconf)->phishing&PHISHING_CONF_ENGINE)
return CL_SUCCESS;
if(!(*engine)->domainlist_matcher) {
if((ret = init_domainlist(*engine))) {
phishing_done(*engine);
@ -702,7 +701,6 @@ static int cli_loadpdb(FILE *fd, struct cl_engine **engine, unsigned int options
return CL_SUCCESS;
}
#endif
#define NDB_TOKENS 6
static int cli_loadndb(FILE *fd, struct cl_engine **engine, unsigned int *signo, unsigned short sdb, unsigned int options)
@ -1187,7 +1185,6 @@ static int cli_load(const char *filename, struct cl_engine **engine, unsigned in
else
#endif
skipped = 1;
#ifdef CL_EXPERIMENTAL
} else if(cli_strbcasestr(filename, ".wdb")) {
if(options & CL_DB_PHISHING_URLS)
ret = cli_loadwdb(fd, engine, options);
@ -1198,7 +1195,6 @@ static int cli_load(const char *filename, struct cl_engine **engine, unsigned in
ret = cli_loadpdb(fd, engine, options);
else
skipped = 1;
#endif
} else {
cli_dbgmsg("cli_load: unknown extension - assuming old database format\n");
ret = cli_loaddb(fd, engine, signo, options);
@ -1278,10 +1274,8 @@ static int cli_loaddbdir_l(const char *dirname, struct cl_engine **engine, unsig
cli_strbcasestr(dent->d_name, ".sdb") ||
cli_strbcasestr(dent->d_name, ".zmd") ||
cli_strbcasestr(dent->d_name, ".rmd") ||
#ifdef CL_EXPERIMENTAL
cli_strbcasestr(dent->d_name, ".pdb") ||
cli_strbcasestr(dent->d_name, ".wdb") ||
#endif
cli_strbcasestr(dent->d_name, ".ncdb") ||
cli_strbcasestr(dent->d_name, ".inc") ||
cli_strbcasestr(dent->d_name, ".cvd"))) {
@ -1435,10 +1429,8 @@ int cl_statinidir(const char *dirname, struct cl_stat *dbstat)
cli_strbcasestr(dent->d_name, ".zmd") ||
cli_strbcasestr(dent->d_name, ".rmd") ||
cli_strbcasestr(dent->d_name, ".cfg") ||
#ifdef CL_EXPERIMENTAL
cli_strbcasestr(dent->d_name, ".pdb") ||
cli_strbcasestr(dent->d_name, ".wdb") ||
#endif
cli_strbcasestr(dent->d_name, ".ncdb") ||
cli_strbcasestr(dent->d_name, ".inc") ||
cli_strbcasestr(dent->d_name, ".cvd"))) {
@ -1549,10 +1541,8 @@ int cl_statchkdir(const struct cl_stat *dbstat)
cli_strbcasestr(dent->d_name, ".zmd") ||
cli_strbcasestr(dent->d_name, ".rmd") ||
cli_strbcasestr(dent->d_name, ".cfg") ||
#ifdef CL_EXPERIMENTAL
cli_strbcasestr(dent->d_name, ".pdb") ||
cli_strbcasestr(dent->d_name, ".wdb") ||
#endif
cli_strbcasestr(dent->d_name, ".ncdb") ||
cli_strbcasestr(dent->d_name, ".inc") ||
cli_strbcasestr(dent->d_name, ".cvd"))) {
@ -1731,9 +1721,8 @@ void cl_free(struct cl_engine *engine)
free(metah);
}
#ifdef CL_EXPERIMENTAL
if(((struct cli_dconf*) engine->dconf)->phishing&PHISHING_CONF_ENGINE)
phishing_done(engine);
#endif
if(engine->dconf)
free(engine->dconf);

Loading…
Cancel
Save