]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Finally fix default parameters parsing in actions section
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 21 Mar 2019 14:29:51 +0000 (14:29 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 21 Mar 2019 14:29:51 +0000 (14:29 +0000)
src/libserver/cfg_rcl.c

index 9ea80a49cf1f4a652a2708a84612616f6a1f2eb9..9a2d7cd193dab5865ed06b70ce67ef191a926125 100644 (file)
@@ -584,6 +584,21 @@ rspamd_rcl_actions_handler (rspamd_mempool_t *pool, const ucl_object_t *obj,
                                        ucl_object_get_priority (cur));
                }
                else if (type == UCL_OBJECT || type == UCL_FLOAT || type == UCL_INT) {
+                       /* Exceptions */
+                       struct rspamd_rcl_default_handler_data *sec_cur, *sec_tmp;
+                       gboolean default_elt = FALSE;
+
+                       HASH_ITER (hh, section->default_parser, sec_cur, sec_tmp) {
+                               if (strcmp (ucl_object_key (cur), sec_cur->key) == 0) {
+                                       default_elt = TRUE;
+                               }
+                       }
+
+                       if (default_elt) {
+                               continue;
+                       }
+
+                       /* Something non-default */
                        if (!rspamd_config_set_action_score (cfg,
                                        ucl_object_key (cur),
                                        cur)) {