commit 6ba7b6d: [Minor] Minor fixes

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Jul 5 17:49:04 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-07-05 18:46:17 +0100
URL: https://github.com/rspamd/rspamd/commit/6ba7b6d32f6bde52b22c4e52381384495b52154a (HEAD -> master)

[Minor] Minor fixes

---
 lualib/lua_meta.lua     |  1 +
 lualib/lua_settings.lua | 10 ++--------
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/lualib/lua_meta.lua b/lualib/lua_meta.lua
index 316c71d3d..984f5fec8 100644
--- a/lualib/lua_meta.lua
+++ b/lualib/lua_meta.lua
@@ -503,6 +503,7 @@ end
 
 exports.rspamd_count_metatokens = rspamd_count_metatokens
 exports.count_metatokens = rspamd_count_metatokens
+exports.version = 1 -- MUST be increased on each change of metatokens
 
 exports.add_metafunction = function(tbl)
   local ret, err = meta_schema(tbl)
diff --git a/lualib/lua_settings.lua b/lualib/lua_settings.lua
index b472386b5..fb1a70217 100644
--- a/lualib/lua_settings.lua
+++ b/lualib/lua_settings.lua
@@ -153,14 +153,7 @@ local function register_settings_cb()
     for _,set in pairs(known_ids) do
       set.symbols = lua_util.keys(fun.filter(function(_, v) return v end, set.symbols))
       table.sort(set.symbols)
-
-      -- Create digest from sorted symbols
-      local cr = require "rspamd_cryptobox_hash"
-      local h = cr.create()
-      for _,sym in ipairs(set.symbols) do
-        h:update(sym)
-      end
-      set.digest = h:base32()
+      set.digest = lua_util.table_digest(set.symbols)
     end
 
     post_init_performed = true
@@ -216,6 +209,7 @@ local function settings_by_id(id)
   return known_ids[id]
 end
 
+
 exports.settings_by_id = settings_by_id
 exports.all_settings = known_ids
 exports.all_symbols = all_symbols


More information about the Commits mailing list