commit c77a640: [Fix] Finally fix default parameters parsing in actions section

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Mar 21 14:35:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-03-21 14:29:51 +0000
URL: https://github.com/rspamd/rspamd/commit/c77a64032de252034f06ab280e01590ef0bb4c95 (HEAD -> master)

[Fix] Finally fix default parameters parsing in actions section

---
 src/libserver/cfg_rcl.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c
index 9ea80a49c..9a2d7cd19 100644
--- a/src/libserver/cfg_rcl.c
+++ b/src/libserver/cfg_rcl.c
@@ -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)) {


More information about the Commits mailing list