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
This commit is contained in:
Andreas Schneider 2018-03-28 07:13:59 +00:00 committed by Git OBS Bridge
parent c8c5ff223f
commit d1fc6e2d19
6 changed files with 48 additions and 90 deletions

View File

@ -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 */
}

20
protocol.c.patch Normal file
View File

@ -0,0 +1,20 @@
commit 7494b0f7ddbcd098da6cf02b40c1db4878cc8310
Author: Vsevolod Stakhov <vsevolod@highsecure.ru>
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);
}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:df85280065277a301306a44d29a7525ee6a3b8ea466225eab49745c643feafe6
size 4586402

3
rspamd-1.7.2.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f78e3533dd2d23147b7010b3eed0295fa3556324812cb8668cdd899349877f90
size 4593754

View File

@ -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 Thu Mar 22 07:07:35 UTC 2018 - iippolitov@gmail.com

View File

@ -14,6 +14,8 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/ # 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} %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 %bcond_without systemd
%else %else
@ -21,29 +23,28 @@
%endif %endif
%ifarch %ix86 %ifarch %ix86
%if 0%{?suse_version} < 1500 %if 0%{?suse_version} > 1500
#no luajit and jemallox for i.86 arch before Tumbleweed #no luajit and jemallox for i.86 arch before Tumbleweed
%bcond_with luajit %bcond_without luajit
%bcond_with jemalloc
%bcond_with ext_hiredis
%bcond_with torch
%endif
%else
%ifarch ppc ppc64 ppc64le
%bcond_with luajit
%bcond_with torch
%else
# x86_64 has jemallow and hiredis.
%bcond_without jemalloc %bcond_without jemalloc
%bcond_without ext_hiredis %bcond_without ext_hiredis
%if ( 0%{?suse_version} && 0%{suse_version} < 1300 ) %bcond_without torch
# older distros don't have luajit and torch requires it %endif
%bcond_with luajit %else
%bcond_with torch
%ifarch ppc ppc64 ppc64le
# 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 %else
%if 0%{?is_opensuse}
# Leap 43.2 and newer has luajit and may have torch # Leap 43.2 and newer has luajit and may have torch
%bcond_without luajit %bcond_without luajit
%bcond_without torch %bcond_without torch
%bcond_without jemalloc
%bcond_without ext_hiredis
%endif %endif
%endif %endif
%endif %endif
@ -57,7 +58,7 @@
%global _wwwdir /srv/www/webapps %global _wwwdir /srv/www/webapps
Name: rspamd Name: rspamd
Version: 1.7.1 Version: 1.7.2
Release: 0 Release: 0
License: Apache-2.0 License: Apache-2.0
Summary: Spam filtering system Summary: Spam filtering system
@ -65,7 +66,7 @@ Url: https://rspamd.com/
Group: Productivity/Networking/Email/Utilities Group: Productivity/Networking/Email/Utilities
Source0: https://github.com/vstakhov/rspamd/archive/%{version}/%{name}-%{version}.tar.gz Source0: https://github.com/vstakhov/rspamd/archive/%{version}/%{name}-%{version}.tar.gz
Source1: rspamd.conf Source1: rspamd.conf
Patch0: lua_util.c.patch Patch0: protocol.c.patch
BuildRequires: cmake BuildRequires: cmake
BuildRequires: curl-devel BuildRequires: curl-devel
@ -161,9 +162,7 @@ simultaneously and has a number of features available.
%endif %endif
-DENABLE_DB=ON \ -DENABLE_DB=ON \
-DENABLE_SQLITE=ON \ -DENABLE_SQLITE=ON \
%if %{with ext_hiredis}
-DENABLE_HIREDIS=ON \ -DENABLE_HIREDIS=ON \
%endif
-DENABLE_URL_INCLUDE=ON \ -DENABLE_URL_INCLUDE=ON \
-DNO_SHARED=ON \ -DNO_SHARED=ON \
-DINSTALL_EXAMPLES=ON \ -DINSTALL_EXAMPLES=ON \