summaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-02-21 11:08:13 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-02-21 11:08:13 +0000
commitb65f3234c48e80ef3494dfb58a9c48cb78822fb7 (patch)
tree7ebea0461676547cbfa0d603149f963a00973346 /src/libserver
parent1464550609b1964829a05b6cec7708f9b91a536f (diff)
downloadrspamd-b65f3234c48e80ef3494dfb58a9c48cb78822fb7.tar.gz
rspamd-b65f3234c48e80ef3494dfb58a9c48cb78822fb7.zip
[Minor] Fix strict config checks
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/cfg_file.h2
-rw-r--r--src/libserver/cfg_utils.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/src/libserver/cfg_file.h b/src/libserver/cfg_file.h
index 1d782dd8b..b368464a0 100644
--- a/src/libserver/cfg_file.h
+++ b/src/libserver/cfg_file.h
@@ -656,7 +656,7 @@ void rspamd_ucl_add_conf_variables (struct ucl_parser *parser, GHashTable *vars)
* @param reconfig
* @return
*/
-gboolean rspamd_init_filters (struct rspamd_config *cfg, bool reconfig);
+gboolean rspamd_init_filters (struct rspamd_config *cfg, bool reconfig, bool strict);
/**
* Add new symbol to the metric
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index bcebb9f93..6a076e673 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -1532,7 +1532,7 @@ rspamd_check_worker (struct rspamd_config *cfg, worker_t *wrk)
}
gboolean
-rspamd_init_filters (struct rspamd_config *cfg, bool reconfig)
+rspamd_init_filters (struct rspamd_config *cfg, bool reconfig, bool strict)
{
GList *cur;
module_t *mod, **pmod;
@@ -1583,8 +1583,12 @@ rspamd_init_filters (struct rspamd_config *cfg, bool reconfig)
}
else {
if (!mod->module_config_func (cfg)) {
- msg_info_config ("config of %s failed!", mod->name);
+ msg_err_config ("config of %s failed", mod->name);
ret = FALSE;
+
+ if (strict) {
+ return FALSE;
+ }
}
}
}
@@ -1596,7 +1600,7 @@ rspamd_init_filters (struct rspamd_config *cfg, bool reconfig)
cur = g_list_next (cur);
}
- ret = rspamd_init_lua_filters (cfg, 0) && ret;
+ ret = rspamd_init_lua_filters (cfg, 0, strict) && ret;
return ret;
}