|
37 | 37 |
|
38 | 38 | #include "clamav.h" |
39 | 39 | #include "others.h" |
40 | | -#include "phish_allow_list.h" |
| 40 | +#include "phish_allow_real_only.h" |
41 | 41 | #include "regex_list.h" |
42 | 42 |
|
43 | 43 | #include "mpool.h" |
44 | 44 |
|
45 | | -cl_error_t allow_list_match(const struct cl_engine* engine, char* real_url, const char* display_url, int hostOnly) |
| 45 | +cl_error_t phish_allow_real_only_match(const struct cl_engine* engine, char* real_url, const char* display_url, int hostOnly) |
46 | 46 | { |
47 | 47 | const char* info; /*unused*/ |
48 | | - cli_dbgmsg("Phishing: looking up in allow list: %s:%s; host-only:%d\n", real_url, display_url, hostOnly); |
49 | | - return engine->allow_list_matcher ? regex_list_match(engine->allow_list_matcher, real_url, display_url, NULL, hostOnly, &info, 1) : 0; |
| 48 | + cli_dbgmsg("Phishing: looking up in real only allow list: %s:%s; host-only:%d\n", real_url, "", hostOnly); |
| 49 | + return engine->phish_allow_real_only_matcher ? regex_list_match(engine->phish_allow_real_only_matcher, real_url, "", NULL, hostOnly, &info, 2) : 0; |
50 | 50 | } |
51 | 51 |
|
52 | | -cl_error_t init_allow_list(struct cl_engine* engine) |
| 52 | +cl_error_t phish_allow_real_only_init(struct cl_engine* engine) |
53 | 53 | { |
54 | 54 | if (engine) { |
55 | | - engine->allow_list_matcher = (struct regex_matcher*)MPOOL_MALLOC(engine->mempool, sizeof(struct regex_matcher)); |
56 | | - if (!engine->allow_list_matcher) { |
| 55 | + engine->phish_allow_real_only_matcher = (struct regex_matcher*)MPOOL_MALLOC(engine->mempool, sizeof(struct regex_matcher)); |
| 56 | + if (!engine->phish_allow_real_only_matcher) { |
57 | 57 | cli_errmsg("Phish_allow_list: Unable to allocate memory for allow_list_match\n"); |
58 | 58 | return CL_EMEM; |
59 | 59 | } |
60 | 60 | #ifdef USE_MPOOL |
61 | | - ((struct regex_matcher*)(engine->allow_list_matcher))->mempool = engine->mempool; |
| 61 | + ((struct regex_matcher*)(engine->phish_allow_real_only_matcher))->mempool = engine->mempool; |
62 | 62 | #endif |
63 | | - return init_regex_list(engine->allow_list_matcher, engine->dconf->other & OTHER_CONF_PREFILTERING); |
| 63 | + return init_regex_list(engine->phish_allow_real_only_matcher, engine->dconf->other & OTHER_CONF_PREFILTERING); |
64 | 64 | } else |
65 | 65 | return CL_ENULLARG; |
66 | 66 | } |
67 | 67 |
|
68 | | -int is_allow_list_ok(const struct cl_engine* engine) |
| 68 | +int phish_is_allow_real_only_ok(const struct cl_engine* engine) |
69 | 69 | { |
70 | | - return (engine && engine->allow_list_matcher) ? is_regex_ok(engine->allow_list_matcher) : 1; |
| 70 | + return (engine && engine->phish_allow_real_only_matcher) ? is_regex_ok(engine->phish_allow_real_only_matcher) : 1; |
71 | 71 | } |
72 | 72 |
|
73 | | -void allow_list_done(struct cl_engine* engine) |
| 73 | +void phish_allow_real_only_done(struct cl_engine* engine) |
74 | 74 | { |
75 | | - if (engine && engine->allow_list_matcher) { |
76 | | - regex_list_done(engine->allow_list_matcher); |
77 | | - MPOOL_FREE(engine->mempool, engine->allow_list_matcher); |
78 | | - engine->allow_list_matcher = NULL; |
| 75 | + if (engine && engine->phish_allow_real_only_matcher) { |
| 76 | + regex_list_done(engine->phish_allow_real_only_matcher); |
| 77 | + MPOOL_FREE(engine->mempool, engine->phish_allow_real_only_matcher); |
| 78 | + engine->phish_allow_real_only_matcher = NULL; |
79 | 79 | } |
80 | 80 | } |
0 commit comments