summaryrefslogtreecommitdiffstats
path: root/src/libserver/cfg_rcl.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-30 18:36:40 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-30 19:40:08 +0100
commitd7c3fa7fe56623e0d8a339a9b43c353e01676a90 (patch)
tree98c32f013223191c0764f97702f0f569d399c839 /src/libserver/cfg_rcl.c
parent0c9d6fa13b904f775ae421549d6145c1ebaf8ab3 (diff)
downloadrspamd-d7c3fa7fe56623e0d8a339a9b43c353e01676a90.tar.gz
rspamd-d7c3fa7fe56623e0d8a339a9b43c353e01676a90.zip
[Minor] Add public flag to the groups
Diffstat (limited to 'src/libserver/cfg_rcl.c')
-rw-r--r--src/libserver/cfg_rcl.c30
1 files changed, 30 insertions, 0 deletions
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);