commit 9895522: [Fix] Add missing groups to C callback symbols

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Jun 24 15:42:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-06-24 16:37:20 +0100
URL: https://github.com/rspamd/rspamd/commit/9895522edd7178259bcee4877ae9662c5f8f5d54 (HEAD -> master)

[Fix] Add missing groups to C callback symbols

---
 src/plugins/dkim_check.c  |  9 +++++++++
 src/plugins/fuzzy_check.c |  8 ++++++++
 src/plugins/spf.c         | 19 +++++++++++++++++--
 src/plugins/surbl.c       | 17 ++++++++++++++++-
 4 files changed, 50 insertions(+), 3 deletions(-)

diff --git a/src/plugins/dkim_check.c b/src/plugins/dkim_check.c
index 233ecf1d1..e1edbccd8 100644
--- a/src/plugins/dkim_check.c
+++ b/src/plugins/dkim_check.c
@@ -529,6 +529,15 @@ dkim_module_config (struct rspamd_config *cfg)
 				NULL,
 				SYMBOL_TYPE_CALLBACK,
 				-1);
+		rspamd_config_add_symbol (cfg,
+				"DKIM_CHECK",
+				0.0,
+				"DKIM check callback",
+				"policies",
+				RSPAMD_SYMBOL_FLAG_IGNORE,
+				1,
+				1);
+		rspamd_config_add_symbol_group (cfg, "DKIM_CHECK", "dkim");
 		rspamd_symcache_add_symbol (cfg->cache,
 				dkim_module_ctx->symbol_reject,
 				0,
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c
index 75df2a645..566c8e93d 100644
--- a/src/plugins/fuzzy_check.c
+++ b/src/plugins/fuzzy_check.c
@@ -1053,6 +1053,14 @@ fuzzy_check_module_config (struct rspamd_config *cfg)
 				"FUZZY_CALLBACK", 0, fuzzy_symbol_callback, NULL,
 				SYMBOL_TYPE_CALLBACK | SYMBOL_TYPE_FINE,
 				-1);
+		rspamd_config_add_symbol (cfg,
+				"FUZZY_CALLBACK",
+				0.0,
+				"Fuzzy check callback",
+				"fuzzy",
+				RSPAMD_SYMBOL_FLAG_IGNORE,
+				1,
+				1);
 
 		/*
 		 * Here we can have 2 possibilities:
diff --git a/src/plugins/spf.c b/src/plugins/spf.c
index f10807f47..89adefbe7 100644
--- a/src/plugins/spf.c
+++ b/src/plugins/spf.c
@@ -300,11 +300,26 @@ spf_module_config (struct rspamd_config *cfg)
 	}
 
 	cb_id = rspamd_symcache_add_symbol (cfg->cache,
-			spf_module_ctx->symbol_fail,
+			"SPF_CHECK",
 			0,
 			spf_symbol_callback,
 			NULL,
-			SYMBOL_TYPE_NORMAL | SYMBOL_TYPE_FINE | SYMBOL_TYPE_EMPTY, -1);
+			SYMBOL_TYPE_CALLBACK | SYMBOL_TYPE_FINE | SYMBOL_TYPE_EMPTY, -1);
+	rspamd_config_add_symbol (cfg,
+			"SPF_CHECK",
+			0.0,
+			"SPF check callback",
+			"policies",
+			RSPAMD_SYMBOL_FLAG_IGNORE,
+			1,
+			1);
+	rspamd_config_add_symbol_group (cfg, "SPF_CHECK", "spf");
+
+	rspamd_symcache_add_symbol (cfg->cache,
+			spf_module_ctx->symbol_fail, 0,
+			NULL, NULL,
+			SYMBOL_TYPE_VIRTUAL,
+			cb_id);
 	rspamd_symcache_add_symbol (cfg->cache,
 			spf_module_ctx->symbol_softfail, 0,
 			NULL, NULL,
diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c
index 3c467615c..34046c819 100644
--- a/src/plugins/surbl.c
+++ b/src/plugins/surbl.c
@@ -83,7 +83,6 @@ struct surbl_ctx {
 	gdouble read_timeout;
 	gboolean use_tags;
 	GList *suffixes;
-	gchar *metric;
 	const gchar *redirector_symbol;
 	GHashTable **exceptions;
 	struct rspamd_hash_map_helper *whitelist;
@@ -860,6 +859,14 @@ surbl_module_parse_rule (const ucl_object_t* value, struct rspamd_config* cfg)
 
 		cb_id = rspamd_symcache_add_symbol (cfg->cache, sym->str,
 				0, surbl_test_url, new_suffix, SYMBOL_TYPE_CALLBACK, -1);
+		rspamd_config_add_symbol (cfg,
+				sym->str,
+				0.0,
+				"SURBL rule check callback",
+				"surbl",
+				RSPAMD_SYMBOL_FLAG_IGNORE,
+				1,
+				1);
 		rspamd_symcache_add_dependency (cfg->cache, cb_id,
 				SURBL_REDIRECTOR_CALLBACK);
 		/* Failure symbol */
@@ -1051,6 +1058,14 @@ surbl_module_config (struct rspamd_config *cfg)
 	(void) rspamd_symcache_add_symbol (cfg->cache, SURBL_REDIRECTOR_CALLBACK,
 			0, surbl_test_redirector, NULL,
 			SYMBOL_TYPE_CALLBACK, -1);
+	rspamd_config_add_symbol (cfg,
+			SURBL_REDIRECTOR_CALLBACK,
+			0.0,
+			"SURBL redirector check callback",
+			"surbl",
+			RSPAMD_SYMBOL_FLAG_IGNORE,
+			1,
+			1);
 
 	if ((value =
 		rspamd_config_get_module_opt (cfg, "surbl", "redirector")) != NULL) {


More information about the Commits mailing list