aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-17 14:38:45 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-17 14:38:45 +0000
commit9d538ae705f4be1c49adc11ae21a366702711b5b (patch)
treec5861c4b2d6e0ab4835bf224aee052e6440fb5d7 /src
parent820021f67c80d21ba9ebb332ee550a7d346153dd (diff)
downloadrspamd-9d538ae705f4be1c49adc11ae21a366702711b5b.tar.gz
rspamd-9d538ae705f4be1c49adc11ae21a366702711b5b.zip
[CritFix] Fix adding symbols to their primary groups
Diffstat (limited to 'src')
-rw-r--r--src/libserver/cfg_utils.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index b874d439e..550e4b730 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -1558,11 +1558,13 @@ rspamd_config_new_symbol (struct rspamd_config *cfg, const gchar *symbol,
/* Search for symbol group */
if (group == NULL) {
group = "ungrouped";
- }
-
- if (strcmp (group, "ungrouped") == 0) {
sym_def->flags |= RSPAMD_SYMBOL_FLAG_UNGROUPPED;
}
+ else {
+ if (strcmp (group, "ungrouped") == 0) {
+ sym_def->flags |= RSPAMD_SYMBOL_FLAG_UNGROUPPED;
+ }
+ }
sym_group = g_hash_table_lookup (cfg->groups, group);
if (sym_group == NULL) {
@@ -1572,6 +1574,10 @@ rspamd_config_new_symbol (struct rspamd_config *cfg, const gchar *symbol,
sym_def->gr = sym_group;
g_hash_table_insert (sym_group->symbols, sym_def->name, sym_def);
+
+ if (!(sym_def->flags & RSPAMD_SYMBOL_FLAG_UNGROUPPED)) {
+ g_ptr_array_add (sym_def->groups, sym_group);
+ }
}