add phishing module definition to dconf

git-svn-id: file:///var/lib/svn/clamav-devel/branches/temp_dconf_phishenable@2981 77e5149b-7576-45b1-b177-96237e5ba77b
remotes/push_mirror/metadata
Török Edvin 18 years ago
parent 293b4d909d
commit ec30bb298f
  1. 33
      libclamav/dconf.c
  2. 4
      libclamav/dconf.h

@ -39,6 +39,12 @@ struct dconf_module {
uint8_t state; /* default state (on/off) */
};
#ifdef CL_EXPERIMENTAL
#define DCONF_ENABLE_EXPERIMENTAL 1
#else
#define DCONF_ENABLE_EXPERIMENTAL 0
#endif
static struct dconf_module modules[] = {
{ "PE", "PARITE", PE_CONF_PARITE, 1 },
@ -88,6 +94,9 @@ static struct dconf_module modules[] = {
{ "OTHER", "JPEG", OTHER_CONF_JPEG, 1 },
{ "OTHER", "CRYPTFF", OTHER_CONF_CRYPTFF, 1 },
{ "PHISHING", "ENGINE", PHISHING_CONF_ENGINE, 1 },
{ "PHISHING", "ENTCONV", PHISHING_CONF_ENTCONV, DCONF_ENABLE_EXPERIMENTAL },/* exp */
{ NULL, NULL, 0, 0 }
};
@ -125,6 +134,9 @@ struct cli_dconf *cli_dconf_init(void)
} else if(!strcmp(modules[i].mname, "OTHER")) {
if(modules[i].state)
dconf->other |= modules[i].bflag;
} else if(!strcmp(modules[i].mname, "PHISHING")) {
if(modules[i].state)
dconf->phishing |= modules[i].bflag;
}
}
@ -133,7 +145,7 @@ struct cli_dconf *cli_dconf_init(void)
void cli_dconf_print(struct cli_dconf *dconf)
{
uint8_t pe = 0, elf = 0, arch = 0, doc = 0, mail = 0, other = 0;
uint8_t pe = 0, elf = 0, arch = 0, doc = 0, mail = 0, other = 0, phishing=0;
unsigned int i;
@ -197,6 +209,16 @@ void cli_dconf_print(struct cli_dconf *dconf)
else
continue;
}
else if(!strcmp(modules[i].mname, "PHISHING")) {
if(!phishing) {
cli_dbgmsg("Module PHISHING %s\n", dconf->phishing ? "On" : "Off");
phishing = 1;
}
if(dconf->phishing)
cli_dbgmsg(" * Submodule %10s:\t%s\n", modules[i].sname, (dconf->phishing & modules[i].bflag) ? "On" : "** Off **");
else
continue;
}
}
}
@ -309,6 +331,15 @@ int cli_dconf_load(FILE *fd, struct cl_engine **engine, unsigned int options)
break;
}
}
if(!strncmp(buffer, "PHISHING:", 9) && chkflevel(buffer, 2)) {
if(sscanf(buffer + 9, "0x%x", &val) == 1) {
dconf->phishing = val;
} else {
ret = CL_EMALFDB;
break;
}
}
}
if(ret) {

@ -31,6 +31,7 @@ struct cli_dconf {
uint32_t doc;
uint32_t mail;
uint32_t other;
uint32_t phishing;
};
/* PE flags */
@ -80,6 +81,9 @@ struct cli_dconf {
#define OTHER_CONF_JPEG 0x8
#define OTHER_CONF_CRYPTFF 0x10
/* Phishing flags */
#define PHISHING_CONF_ENGINE 0x1
#define PHISHING_CONF_ENTCONV 0x2
struct cli_dconf *cli_dconf_init(void);
void cli_dconf_print(struct cli_dconf *dconf);

Loading…
Cancel
Save