aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstat/tokenizers
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-27 15:32:00 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-27 15:32:00 +0100
commit52b516b6aa93fef63979404bd581abf4ec587feb (patch)
treea29b61522998ed6b01509457a8832bb5d1faf6e0 /src/libstat/tokenizers
parent88f30e7b837e445c5942e43abdee3a451b29f7ff (diff)
downloadrspamd-52b516b6aa93fef63979404bd581abf4ec587feb.tar.gz
rspamd-52b516b6aa93fef63979404bd581abf4ec587feb.zip
Fix issues with compatibility tokenization.
Diffstat (limited to 'src/libstat/tokenizers')
-rw-r--r--src/libstat/tokenizers/osb.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libstat/tokenizers/osb.c b/src/libstat/tokenizers/osb.c
index 40dec0d82..bbb2656c2 100644
--- a/src/libstat/tokenizers/osb.c
+++ b/src/libstat/tokenizers/osb.c
@@ -347,8 +347,16 @@ rspamd_tokenizer_osb_load_config (rspamd_mempool_t *pool,
{
struct rspamd_osb_tokenizer_config *osb_cf;
- if (ptr == NULL) {
+ if (ptr == NULL || len == 0) {
osb_cf = rspamd_tokenizer_osb_config_from_ucl (pool, rt->tkcf->opts);
+
+ if (osb_cf->ht != RSPAMD_OSB_HASH_COMPAT) {
+ /* Trying to load incompatible configuration */
+ msg_err ("cannot load tokenizer configuration from a legacy statfile,"
+ " maybe you have forgotten to set 'compat' option in the "
+ "tokenizer configuration");
+ return FALSE;
+ }
}
else {
g_assert (len == sizeof (*osb_cf));