diff options
Diffstat (limited to 'src/lua')
-rw-r--r-- | src/lua/lua_cfg_file.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/lua/lua_cfg_file.c b/src/lua/lua_cfg_file.c index 9ad333132..c73173f97 100644 --- a/src/lua/lua_cfg_file.c +++ b/src/lua/lua_cfg_file.c @@ -24,6 +24,8 @@ #include "lua_common.h" #include "symbols_cache.h" +#include "expression.h" +#include "filter.h" #ifdef HAVE_SYS_UTSNAME_H #include <sys/utsname.h> #endif @@ -139,9 +141,10 @@ rspamd_lua_post_load_config (struct rspamd_config *cfg) lua_State *L = cfg->lua_state; const gchar *name, *val; gchar *sym; - struct expression *expr, *old_expr; + struct rspamd_expression *expr, *old_expr; ucl_object_t *obj; gsize keylen; + GError *err = NULL; /* First check all module options that may be overriden in 'config' global */ lua_getglobal (L, "config"); @@ -192,10 +195,12 @@ rspamd_lua_post_load_config (struct rspamd_config *cfg) if (name != NULL && lua_isstring (L, -1)) { val = lua_tostring (L, -1); sym = rspamd_mempool_strdup (cfg->cfg_pool, name); - if ((expr = - parse_expression (cfg->cfg_pool, - rspamd_mempool_strdup (cfg->cfg_pool, val))) == NULL) { - msg_err ("cannot parse composite expression: %s", val); + if (!rspamd_parse_expression (val, 0, &composite_expr_subr, NULL, + cfg->cfg_pool, &err, &expr)) { + msg_err ("cannot parse composite expression '%s': %s", val, + err->message); + g_error_free (err); + err = NULL; continue; } /* Now check hash table for this composite */ |