diff options
Diffstat (limited to 'src/libserver/cfg_rcl.c')
-rw-r--r-- | src/libserver/cfg_rcl.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c index a099ccda3..2869adacc 100644 --- a/src/libserver/cfg_rcl.c +++ b/src/libserver/cfg_rcl.c @@ -1430,7 +1430,7 @@ rspamd_rcl_composite_handler (rspamd_mempool_t *pool, } composite = - rspamd_mempool_alloc (cfg->cfg_pool, sizeof (struct rspamd_composite)); + rspamd_mempool_alloc0 (cfg->cfg_pool, sizeof (struct rspamd_composite)); composite->expr = expr; composite->id = g_hash_table_size (cfg->composite_symbols); g_hash_table_insert (cfg->composite_symbols, @@ -1474,6 +1474,21 @@ rspamd_rcl_composite_handler (rspamd_mempool_t *pool, description, group, FALSE, FALSE); } + val = ucl_object_lookup (obj, "policy"); + + if (val) { + composite->policy = rspamd_composite_policy_from_str ( + ucl_object_tostring (val)); + + if (composite->policy == RSPAMD_COMPOSITE_POLICY_UNKNOWN) { + g_set_error (err, + CFG_RCL_ERROR, + EINVAL, + "composite %s has incorrect policy", composite_name); + return FALSE; + } + } + return TRUE; } |