From d1fc6e2d19c09644a509e8c33357ca72e7f49607977e3a1528ceb4f290800064 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 28 Mar 2018 07:13:59 +0000 Subject: [PATCH] Accepting request 591815 from home:ippolitov:branches:server:mail - updated version to 1.7.2 https://github.com/vstakhov/rspamd/releases/tag/1.7.2 - fix for https://github.com/vstakhov/rspamd/issues/2120 included OBS-URL: https://build.opensuse.org/request/show/591815 OBS-URL: https://build.opensuse.org/package/show/server:mail/rspamd?expand=0&rev=13 --- lua_util.c.patch | 68 --------------------------------------------- protocol.c.patch | 20 +++++++++++++ rspamd-1.7.1.tar.gz | 3 -- rspamd-1.7.2.tar.gz | 3 ++ rspamd.changes | 7 +++++ rspamd.spec | 37 ++++++++++++------------ 6 files changed, 48 insertions(+), 90 deletions(-) delete mode 100644 lua_util.c.patch create mode 100644 protocol.c.patch delete mode 100644 rspamd-1.7.1.tar.gz create mode 100644 rspamd-1.7.2.tar.gz diff --git a/lua_util.c.patch b/lua_util.c.patch deleted file mode 100644 index 1bf1576..0000000 --- a/lua_util.c.patch +++ /dev/null @@ -1,68 +0,0 @@ -index 222a48f35..ad38e771e 100644 ---- a/src/lua/lua_util.c -+++ b/src/lua/lua_util.c -@@ -2471,14 +2471,19 @@ COMPAT53_API void - luaL_buffinit (lua_State *L, luaL_Buffer_53 *B) - { - /* make it crash if used via pointer to a 5.1-style luaL_Buffer */ -+#if LUA_VERSION_NUM < 502 - B->b.p = NULL; - B->b.L = NULL; - B->b.lvl = 0; - /* reuse the buffer from the 5.1-style luaL_Buffer though! */ - B->ptr = B->b.buffer; -- B->capacity = LUAL_BUFFERSIZE; - B->nelems = 0; -- B->L2 = L; -+#elif LUA_VERSION_NUM == 502 -+ B->ptr = B->b.b; -+ B->nelems = B->b.n; -+#endif -+ B->capacity = LUAL_BUFFERSIZE; -+ B->L2 = L; - } - - -@@ -2494,7 +2499,11 @@ luaL_prepbuffsize (luaL_Buffer_53 *B, size_t s) - luaL_error (B->L2, "buffer too large"); - newptr = (char *) lua_newuserdata (B->L2, newcap); - memcpy(newptr, B->ptr, B->nelems); -+#if LUA_VERSION_NUM < 502 - if (B->ptr != B->b.buffer) -+#elif LUA_VERSION_NUM == 502 -+ if (B->ptr != B->b.b) -+#endif - lua_replace (B->L2, -2); /* remove old buffer */ - B->ptr = newptr; - B->capacity = newcap; -@@ -2518,10 +2527,18 @@ luaL_addvalue (luaL_Buffer_53 *B) - const char *s = lua_tolstring (B->L2, -1, &len); - if (!s) - luaL_error (B->L2, "cannot convert value to string"); -+#if LUA_VERSION_NUM < 502 - if (B->ptr != B->b.buffer) -+#elif LUA_VERSION_NUM == 502 -+ if (B->ptr != B->b.b) -+#endif - lua_insert (B->L2, -2); /* userdata buffer must be at stack top */ - luaL_addlstring (B, s, len); -+#if LUA_VERSION_NUM < 502 - lua_remove (B->L2, B->ptr != B->b.buffer ? -2 : -1); -+#elif LUA_VERSION_NUM == 502 -+ lua_remove (B->L2, B->ptr != B->b.b ? -2 : -1); -+#endif - } - - -@@ -2529,7 +2546,11 @@ COMPAT53_API void - luaL_pushresult (luaL_Buffer_53 *B) - { - lua_pushlstring (B->L2, B->ptr, B->nelems); -+#if LUA_VERSION_NUM < 502 - if (B->ptr != B->b.buffer) -+#elif LUA_VERSION_NUM == 502 -+ if (B->ptr != B->b.b) -+#endif - lua_replace (B->L2, -2); /* remove userdata buffer */ - } - diff --git a/protocol.c.patch b/protocol.c.patch new file mode 100644 index 0000000..70a4f46 --- /dev/null +++ b/protocol.c.patch @@ -0,0 +1,20 @@ +commit 7494b0f7ddbcd098da6cf02b40c1db4878cc8310 +Author: Vsevolod Stakhov +Date: Tue Mar 27 13:24:53 2018 +0100 + + [CritFix] Plug bad memory leak in protocol reply + +diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c +index 6662bf677..77bbe04bf 100644 +--- a/src/libserver/protocol.c ++++ b/src/libserver/protocol.c +@@ -1059,6 +1059,9 @@ rspamd_protocol_write_ucl (struct rspamd_task *task, + rspamd_task_set_finish_time (task); + top = ucl_object_typed_new (UCL_OBJECT); + ++ rspamd_mempool_add_destructor (task->task_pool, ++ (rspamd_mempool_destruct_t)ucl_object_unref, top); ++ + if (flags & RSPAMD_PROTOCOL_METRICS) { + rspamd_metric_result_ucl (task, task->result, top); + } diff --git a/rspamd-1.7.1.tar.gz b/rspamd-1.7.1.tar.gz deleted file mode 100644 index 12939c8..0000000 --- a/rspamd-1.7.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:df85280065277a301306a44d29a7525ee6a3b8ea466225eab49745c643feafe6 -size 4586402 diff --git a/rspamd-1.7.2.tar.gz b/rspamd-1.7.2.tar.gz new file mode 100644 index 0000000..d39c890 --- /dev/null +++ b/rspamd-1.7.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f78e3533dd2d23147b7010b3eed0295fa3556324812cb8668cdd899349877f90 +size 4593754 diff --git a/rspamd.changes b/rspamd.changes index 37d5614..d9f2c37 100644 --- a/rspamd.changes +++ b/rspamd.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Mar 27 17:20:28 UTC 2018 - iippolitov@gmail.com + +- updated version to 1.7.2 + https://github.com/vstakhov/rspamd/releases/tag/1.7.2 +- fix for https://github.com/vstakhov/rspamd/issues/2120 included + ------------------------------------------------------------------- Thu Mar 22 07:07:35 UTC 2018 - iippolitov@gmail.com diff --git a/rspamd.spec b/rspamd.spec index 6314aef..28d83b1 100644 --- a/rspamd.spec +++ b/rspamd.spec @@ -14,6 +14,8 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # +%{echo: building for suse: ver:%{suse_version} arch:%{_arch} o:%{is_opensuse} "\n"} + %if 0%{?suse_version} > 1230 || 0%{?rhel_version} > 600 || 0%{?centos_version} > 600 || 0%{?fedora_version} >= 20 || 0%{?el7}%{?fc20}%{?fc21}%{?fc22}%{?fc23}%{?fc24}%{?fc25} %bcond_without systemd %else @@ -21,29 +23,28 @@ %endif %ifarch %ix86 - %if 0%{?suse_version} < 1500 + %if 0%{?suse_version} > 1500 #no luajit and jemallox for i.86 arch before Tumbleweed - %bcond_with luajit - %bcond_with jemalloc - %bcond_with ext_hiredis - %bcond_with torch + %bcond_without luajit + %bcond_without jemalloc + %bcond_without ext_hiredis + %bcond_without torch %endif %else + %ifarch ppc ppc64 ppc64le - %bcond_with luajit - %bcond_with torch + # no jemalloc for PPC builds (either too old, or absent at all) + %if 0%{?sle_version} != 150000 + #no hiredis for SLE_15 on ppc64le + %bcond_without ext_hiredis + %endif %else - # x86_64 has jemallow and hiredis. - %bcond_without jemalloc - %bcond_without ext_hiredis - %if ( 0%{?suse_version} && 0%{suse_version} < 1300 ) - # older distros don't have luajit and torch requires it - %bcond_with luajit - %bcond_with torch - %else + %if 0%{?is_opensuse} # Leap 43.2 and newer has luajit and may have torch %bcond_without luajit %bcond_without torch + %bcond_without jemalloc + %bcond_without ext_hiredis %endif %endif %endif @@ -57,7 +58,7 @@ %global _wwwdir /srv/www/webapps Name: rspamd -Version: 1.7.1 +Version: 1.7.2 Release: 0 License: Apache-2.0 Summary: Spam filtering system @@ -65,7 +66,7 @@ Url: https://rspamd.com/ Group: Productivity/Networking/Email/Utilities Source0: https://github.com/vstakhov/rspamd/archive/%{version}/%{name}-%{version}.tar.gz Source1: rspamd.conf -Patch0: lua_util.c.patch +Patch0: protocol.c.patch BuildRequires: cmake BuildRequires: curl-devel @@ -161,9 +162,7 @@ simultaneously and has a number of features available. %endif -DENABLE_DB=ON \ -DENABLE_SQLITE=ON \ - %if %{with ext_hiredis} -DENABLE_HIREDIS=ON \ - %endif -DENABLE_URL_INCLUDE=ON \ -DNO_SHARED=ON \ -DINSTALL_EXAMPLES=ON \