diff options
Diffstat (limited to 'mail-filter/rspamd/files')
4 files changed, 20 insertions, 166 deletions
diff --git a/mail-filter/rspamd/files/rspamd-3.0-fix-null-dereference.patch b/mail-filter/rspamd/files/rspamd-3.0-fix-null-dereference.patch deleted file mode 100644 index d355f701a273..000000000000 --- a/mail-filter/rspamd/files/rspamd-3.0-fix-null-dereference.patch +++ /dev/null @@ -1,46 +0,0 @@ -From abea3ac21f764658a966dad475fc99e4b79530d7 Mon Sep 17 00:00:00 2001 -From: Jan Smutny <js@excello.cz> -Date: Tue, 31 Aug 2021 14:25:23 +0200 -Subject: [PATCH] [Fix] src/lua/lua_mimepart.c: fix null dereference - ---- - -This patch is taken from upstream. It fixes possible runtime segfaults. - -PR: https://github.com/rspamd/rspamd/pull/3873 - -diff --git a/src/lua/lua_mimepart.c b/src/lua/lua_mimepart.c -index 66b588e3a..21a46d496 100644 ---- a/src/lua/lua_mimepart.c -+++ b/src/lua/lua_mimepart.c -@@ -1240,7 +1240,16 @@ lua_textpart_get_fuzzy_hashes (lua_State * L) - rspamd_stat_token_t *word; - struct lua_shingle_filter_cbdata cbd; - -- if (part && pool) { -+ -+ if (part == NULL || pool == NULL) { -+ return luaL_error (L, "invalid arguments"); -+ } -+ -+ if (IS_TEXT_PART_EMPTY (part) || part->utf_words == NULL) { -+ lua_pushnil (L); -+ lua_pushnil (L); -+ } -+ else { - /* TODO: add keys and algorithms support */ - rspamd_cryptobox_hash (key, "rspamd", strlen ("rspamd"), NULL, 0); - -@@ -1294,9 +1303,6 @@ lua_textpart_get_fuzzy_hashes (lua_State * L) - } - } - } -- else { -- return luaL_error (L, "invalid arguments"); -- } - - return 2; - } --- -2.31.1 - diff --git a/mail-filter/rspamd/files/rspamd-3.0-system-doctest.patch b/mail-filter/rspamd/files/rspamd-3.0-system-doctest.patch deleted file mode 100644 index bb315ee7a459..000000000000 --- a/mail-filter/rspamd/files/rspamd-3.0-system-doctest.patch +++ /dev/null @@ -1,72 +0,0 @@ -From d37a3764e9889e6de0a7341ba3195ee8a314de23 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20Van=C4=9Bk?= <arkamar@atlas.cz> -Date: Wed, 1 Sep 2021 13:30:56 +0200 -Subject: [PATCH] Add SYSTEM_DOCTEST cmake option - -This gives packagers option to use system version of doctest rather than -bundled one. It is disabled by default. Additionally, there is no need -to link rspamd-test-cxx with doctest as it is is single header library. - -Main reason for this change is that currently bundled version of -doctest-2.4.5 can't compile with glibc-2.34 [1]. However, this issue was -already fixed in upstream doctest-2.4.6 [2] in commit [3]. With this, -packagers can just bump doctest to fixed version. - -[1] https://github.com/onqtam/doctest/issues/473 -[2] https://github.com/onqtam/doctest/blob/master/CHANGELOG.md#246-2021-03-22 -[3] https://github.com/onqtam/doctest/commit/099d5414e97244ec44cf46b14cd176b3a3dc52e3 ---- - -Merged-to-upstream: https://github.com/rspamd/rspamd/pull/3875 - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index fc4175677..ced49730d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -59,6 +59,7 @@ OPTION(ENABLE_LUA_TRACE "Trace all Lua C API invocations [default: OFF]" OFF) - OPTION(ENABLE_LUA_REPL "Enables Lua repl (requires C++11 compiler) [default: ON]" ON) - OPTION(SYSTEM_ZSTD "Use system zstd instead of bundled one [default: OFF]" OFF) - OPTION(SYSTEM_FMT "Use system fmt instead of bundled one [defalut: OFF]" OFF) -+OPTION(SYSTEM_DOCTEST "Use system doctest instead of bundled one [default: OFF]" OFF) - - ############################# INCLUDE SECTION ############################################# - -@@ -118,7 +119,6 @@ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/" - "${CMAKE_SOURCE_DIR}/contrib/lc-btrie" - "${CMAKE_SOURCE_DIR}/contrib/lua-lpeg" - "${CMAKE_SOURCE_DIR}/contrib/frozen/include" -- "${CMAKE_SOURCE_DIR}/contrib/doctest" - "${CMAKE_SOURCE_DIR}/contrib/fu2/include" - "${CMAKE_BINARY_DIR}/src" #Stored in the binary dir - "${CMAKE_BINARY_DIR}/src/libcryptobox") -@@ -656,7 +656,12 @@ IF(SYSTEM_FMT MATCHES "OFF") - ELSE() - find_package(fmt) - ENDIF() --ADD_SUBDIRECTORY(contrib/doctest) -+IF(SYSTEM_DOCTEST MATCHES "OFF") -+ ADD_SUBDIRECTORY(contrib/doctest) -+ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/contrib/doctest") -+ELSE() -+ find_package(doctest) -+ENDIF() - - IF (NOT WITH_LUAJIT) - ADD_SUBDIRECTORY(contrib/lua-bit) -diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt -index 9e56cbad7..08e9556f3 100644 ---- a/test/CMakeLists.txt -+++ b/test/CMakeLists.txt -@@ -24,9 +24,7 @@ SET(CXXTESTSSRC rspamd_cxx_unit.cxx) - ADD_EXECUTABLE(rspamd-test-cxx EXCLUDE_FROM_ALL ${CXXTESTSSRC}) - SET_TARGET_PROPERTIES(rspamd-test-cxx PROPERTIES LINKER_LANGUAGE CXX) - ADD_DEPENDENCIES(rspamd-test-cxx rspamd-server) --ADD_DEPENDENCIES(rspamd-test-cxx doctest) - TARGET_LINK_LIBRARIES(rspamd-test-cxx PRIVATE rspamd-server) --TARGET_LINK_LIBRARIES(rspamd-test-cxx PRIVATE doctest) - SET_TARGET_PROPERTIES(rspamd-test-cxx PROPERTIES LINKER_LANGUAGE CXX) - - IF(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") --- -2.31.1 - diff --git a/mail-filter/rspamd/files/rspamd-3.0-system-libfmt.patch b/mail-filter/rspamd/files/rspamd-3.0-system-libfmt.patch deleted file mode 100644 index a6439b465e92..000000000000 --- a/mail-filter/rspamd/files/rspamd-3.0-system-libfmt.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 309bb213cffb23e6bee98157b53cf5db31f97ef9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20Van=C4=9Bk?= <arkamar@atlas.cz> -Date: Sat, 21 Aug 2021 11:24:35 +0200 -Subject: [PATCH] Add SYSTEM_FMT cmake option - -This gives packagers option to use system version of fmt rather than -bundled one. It is disabled by default. ---- - -Merged-to-upstream: https://github.com/rspamd/rspamd/pull/3855 - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2c38758f3..fc4175677 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -58,6 +58,7 @@ OPTION(ENABLE_LIBUNWIND "Use libunwind to print crash traces [default: OFF]" - OPTION(ENABLE_LUA_TRACE "Trace all Lua C API invocations [default: OFF]" OFF) - OPTION(ENABLE_LUA_REPL "Enables Lua repl (requires C++11 compiler) [default: ON]" ON) - OPTION(SYSTEM_ZSTD "Use system zstd instead of bundled one [default: OFF]" OFF) -+OPTION(SYSTEM_FMT "Use system fmt instead of bundled one [defalut: OFF]" OFF) - - ############################# INCLUDE SECTION ############################################# - -@@ -117,7 +118,6 @@ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/" - "${CMAKE_SOURCE_DIR}/contrib/lc-btrie" - "${CMAKE_SOURCE_DIR}/contrib/lua-lpeg" - "${CMAKE_SOURCE_DIR}/contrib/frozen/include" -- "${CMAKE_SOURCE_DIR}/contrib/fmt/include" - "${CMAKE_SOURCE_DIR}/contrib/doctest" - "${CMAKE_SOURCE_DIR}/contrib/fu2/include" - "${CMAKE_BINARY_DIR}/src" #Stored in the binary dir -@@ -650,7 +650,12 @@ ADD_SUBDIRECTORY(contrib/libev) - ADD_SUBDIRECTORY(contrib/kann) - ADD_SUBDIRECTORY(contrib/fastutf8) - ADD_SUBDIRECTORY(contrib/google-ced) --ADD_SUBDIRECTORY(contrib/fmt) -+IF(SYSTEM_FMT MATCHES "OFF") -+ ADD_SUBDIRECTORY(contrib/fmt) -+ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/contrib/fmt/include") -+ELSE() -+ find_package(fmt) -+ENDIF() - ADD_SUBDIRECTORY(contrib/doctest) - - IF (NOT WITH_LUAJIT) --- -2.31.1 - diff --git a/mail-filter/rspamd/files/rspamd-3.3-remove-test-case.patch b/mail-filter/rspamd/files/rspamd-3.3-remove-test-case.patch new file mode 100644 index 000000000000..0cad11382b21 --- /dev/null +++ b/mail-filter/rspamd/files/rspamd-3.3-remove-test-case.patch @@ -0,0 +1,20 @@ +Remove test case which does not work with luajit-2.1 anymore as it +depends on internal behavior of lujait-2.0. + +Upstream-PR: https://github.com/rspamd/rspamd/pull/4323 + +diff --git a/test/lua/unit/lua_util.extract_specific_urls.lua b/test/lua/unit/lua_util.extract_specific_urls.lua +index 05ffeb7b0..a7e2f9f48 100644 +--- a/test/lua/unit/lua_util.extract_specific_urls.lua ++++ b/test/lua/unit/lua_util.extract_specific_urls.lua +@@ -108,7 +108,6 @@ context("Lua util - extract_specific_urls plain", function() + local cases = { + {expect = url_list, filter = nil, limit = 9999, need_emails = true, prefix = 'p'}, + {expect = {}, filter = (function() return false end), limit = 9999, need_emails = true, prefix = 'p'}, +- {expect = {"domain4.co.net", "test.com"}, filter = nil, limit = 2, need_emails = true, prefix = 'p'}, + {expect = {"domain4.co.net", "test.com", "domain3.org"}, filter = nil, limit = 3, need_emails = true, prefix = 'p'}, + { + expect = {"gov.co.net", "tesco.co.net", "domain1.co.net", "domain2.co.net", "domain3.co.net", "domain4.co.net"}, +-- +2.37.4 + |