update to rspamd-3.4

This commit is contained in:
sthen 2022-11-04 09:04:28 +00:00
parent a45f2f7bf3
commit 50119b2d13
7 changed files with 4 additions and 119 deletions

View File

@ -2,8 +2,7 @@ COMMENT= event-driven spam filtering system in C/Lua
GH_ACCOUNT= vstakhov
GH_PROJECT= rspamd
GH_TAGNAME= 3.3
REVISION= 2
GH_TAGNAME= 3.4
CATEGORIES= mail

View File

@ -1,2 +1,2 @@
SHA256 (rspamd-3.3.tar.gz) = TW6Q+s0PdwXRHVBz26IrXWaGCXeYF4s7PpZamJunvg8=
SIZE (rspamd-3.3.tar.gz) = 5680874
SHA256 (rspamd-3.4.tar.gz) = +NPiuaGm7WUhxg/lBelwhmJEB/ZzZvDOiC7uQzpTw1U=
SIZE (rspamd-3.4.tar.gz) = 5689732

View File

@ -1,51 +0,0 @@
From ded2e51e60325a0e817362c6df0c341bb00d4b0e Mon Sep 17 00:00:00 2001
From: Vsevolod Stakhov <vsevolod@rspamd.com>
Date: Sat, 22 Oct 2022 13:00:21 +0100
Subject: [PATCH] [CritFix] Restore compatibility with the integrations and
headers alterations
From 272503b1ba88fe9802192ef65a1f7674e0a51f2b Mon Sep 17 00:00:00 2001
From: Vsevolod Stakhov <vsevolod@rspamd.com>
Date: Sat, 22 Oct 2022 13:17:45 +0100
Subject: [PATCH] [Minor] Fix corner cases
Index: lualib/lua_mime.lua
--- lualib/lua_mime.lua.orig
+++ lualib/lua_mime.lua
@@ -515,8 +515,11 @@ end
--[[[
-- @function lua_mime.modify_headers(task, {add = {hname = {value = 'value', order = 1}}, remove = {hname = {1,2}}})
-- Adds/removes headers both internal and in the milter reply
+-- Mode defines to be compatible with Rspamd <=3.2 and is the default (equal to 'compat')
--]]
-exports.modify_headers = function(task, hdr_alterations)
+exports.modify_headers = function(task, hdr_alterations, mode)
+ -- Assume default mode compatibility
+ if not mode then mode = 'compat' end
local add = hdr_alterations.add or {}
local remove = hdr_alterations.remove or {}
@@ -550,6 +553,11 @@ exports.modify_headers = function(task, hdr_alteration
else
logger.errx(task, 'invalid modification of header: %s', hdr)
end
+
+ if mode == 'compat' and #add_headers[hname] == 1 then
+ -- Switch to the compatibility mode
+ add_headers[hname] = add_headers[hname][1]
+ end
end
if hdr_alterations.order then
-- Get headers alterations ordered
@@ -580,6 +588,11 @@ exports.modify_headers = function(task, hdr_alteration
end
end
+ if mode == 'compat' then
+ -- Clear empty alterations in the compat mode
+ if add_headers and not next(add_headers) then add_headers = nil end
+ if hdr_alterations.remove and not next(hdr_alterations.remove) then hdr_alterations.remove = nil end
+ end
task:set_milter_reply({
add_headers = add_headers,
remove_headers = hdr_alterations.remove

View File

@ -2,7 +2,7 @@ Index: src/CMakeLists.txt
--- src/CMakeLists.txt.orig
+++ src/CMakeLists.txt
@@ -231,9 +231,9 @@ TARGET_LINK_LIBRARIES(rspamd-server ${RSPAMD_REQUIRED_
ADD_EXECUTABLE(rspamd ${RSPAMDSRC} ${CMAKE_CURRENT_BINARY_DIR}/workers.c)
ADD_EXECUTABLE(rspamd ${RSPAMDSRC} ${CMAKE_CURRENT_BINARY_DIR}/workers.c ${CMAKE_CURRENT_BINARY_DIR}/config.h)
SET_TARGET_PROPERTIES(rspamd PROPERTIES LINKER_LANGUAGE CXX)
SET_TARGET_PROPERTIES(rspamd-server PROPERTIES LINKER_LANGUAGE CXX)
-IF(NOT DEBIAN_BUILD)

View File

@ -1,20 +0,0 @@
From 420cb619af8b6d9d8be871caef77b4c81d60419a Mon Sep 17 00:00:00 2001
From: Vsevolod Stakhov <vsevolod@rspamd.com>
Date: Tue, 4 Oct 2022 23:58:42 +0100
Subject: [PATCH] [Minor] Do not use names starting from `_` as they might be
reserved
Index: src/libserver/symcache/symcache_internal.hxx
--- src/libserver/symcache/symcache_internal.hxx.orig
+++ src/libserver/symcache/symcache_internal.hxx
@@ -139,8 +139,8 @@ struct delayed_cache_condition {
int cbref;
lua_State *L;
public:
- delayed_cache_condition(std::string_view _sym, int _cbref, lua_State *_L) :
- sym(_sym), cbref(_cbref), L(_L) {}
+ delayed_cache_condition(std::string_view _sym, int _cbref, lua_State *_LS) :
+ sym(_sym), cbref(_cbref), L(_LS) {}
};
class delayed_symbol_elt {

View File

@ -1,17 +0,0 @@
OpenBSD doesn't have GNU ffsll() but both gcc and clang have it as builtin.
Remove for next release; obsoleted by
https://github.com/rspamd/rspamd/commit/a30002b1c83196a621aa6d6bd24b91d39f312ca2
Index: src/libutil/printf.c
--- src/libutil/printf.c.orig
+++ src/libutil/printf.c
@@ -42,6 +42,8 @@
#include "str_util.h"
#include "contrib/fpconv/fpconv.h"
+#define ffsll __builtin_ffsll
+
/**
* From FreeBSD libutil code
*/

View File

@ -1,26 +0,0 @@
From ded2e51e60325a0e817362c6df0c341bb00d4b0e Mon Sep 17 00:00:00 2001
From: Vsevolod Stakhov <vsevolod@rspamd.com>
Date: Sat, 22 Oct 2022 13:00:21 +0100
Subject: [PATCH] [CritFix] Restore compatibility with the integrations and
headers alterations
Index: src/plugins/lua/milter_headers.lua
--- src/plugins/lua/milter_headers.lua.orig
+++ src/plugins/lua/milter_headers.lua
@@ -39,6 +39,7 @@ local settings = {
skip_all = false,
local_headers = {},
authenticated_headers = {},
+ headers_modify_mode = 'compat', -- To avoid compatibility issues on upgrade
default_headers_order = nil, -- Insert at the end (set 1 to insert just after the first received)
routines = {
['remove-headers'] = {
@@ -572,7 +573,7 @@ local function milter_headers(task)
lua_mime.modify_headers(task, {
add = add,
remove = remove
- })
+ }, settings.headers_modify_mode)
end
end