diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libserver/cfg_file.h | 1 | ||||
-rw-r--r-- | src/libserver/cfg_rcl.c | 30 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/libserver/cfg_file.h b/src/libserver/cfg_file.h index 1fd56441c..9573b776a 100644 --- a/src/libserver/cfg_file.h +++ b/src/libserver/cfg_file.h @@ -109,6 +109,7 @@ enum rspamd_symbol_group_flags { RSPAMD_SYMBOL_GROUP_DISABLED = (1 << 0), RSPAMD_SYMBOL_GROUP_ONE_SHOT = (1 << 1), RSPAMD_SYMBOL_GROUP_UNGROUPED = (1 << 2), + RSPAMD_SYMBOL_GROUP_PUBLIC = (1 << 3), }; /** diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c index 5a10a6c3e..d224b4029 100644 --- a/src/libserver/cfg_rcl.c +++ b/src/libserver/cfg_rcl.c @@ -389,6 +389,36 @@ rspamd_rcl_group_handler (rspamd_mempool_t *pool, const ucl_object_t *obj, } } + if ((elt = ucl_object_lookup (obj, "public")) != NULL) { + if (ucl_object_type (elt) != UCL_BOOLEAN) { + g_set_error (err, + CFG_RCL_ERROR, + EINVAL, + "public attribute is not boolean for symbol: '%s'", + key); + + return FALSE; + } + if (ucl_object_toboolean (elt)) { + gr->flags |= RSPAMD_SYMBOL_GROUP_PUBLIC; + } + } + + if ((elt = ucl_object_lookup (obj, "private")) != NULL) { + if (ucl_object_type (elt) != UCL_BOOLEAN) { + g_set_error (err, + CFG_RCL_ERROR, + EINVAL, + "private attribute is not boolean for symbol: '%s'", + key); + + return FALSE; + } + if (!ucl_object_toboolean (elt)) { + gr->flags |= RSPAMD_SYMBOL_GROUP_PUBLIC; + } + } + elt = ucl_object_lookup (obj, "description"); if (elt) { description = ucl_object_tostring (elt); |