update to dovecot-fts-xapian-1.5.5, fixing segfault with Dovecot 2.3.17+

From William Orr, plus drop Tom Wong-Cornall as maintainer as he's moved to
dovecot-fts-flatcurve.
This commit is contained in:
sthen 2022-04-27 10:05:15 +00:00
parent 9f2c5aafb6
commit 8253f5d5e5
5 changed files with 107 additions and 6 deletions

View File

@ -2,15 +2,12 @@ COMMENT= full text search plugin for Dovecot using Xapian
GH_ACCOUNT= grosjo
GH_PROJECT= fts-xapian
GH_TAGNAME= 1.4.8
REVISION= 2
GH_TAGNAME= 1.5.5
PKGNAME= dovecot-${DISTNAME}
CATEGORIES= mail
MAINTAINER= Tom Wong-Cornall <tom@wongcornall.com>
# LGPLv2.1
PERMIT_PACKAGE= Yes

View File

@ -1,2 +1,2 @@
SHA256 (fts-xapian-1.4.8.tar.gz) = VHzIdCXFnV+7O3+BEg8L0B3Wx4rSNNPXUMAvQhgE43Q=
SIZE (fts-xapian-1.4.8.tar.gz) = 29381
SHA256 (fts-xapian-1.5.5.tar.gz) = AqnOaVC4HNMMw+tuPd6Ab+GD/VArjrCXSh5UxCUMBCk=
SIZE (fts-xapian-1.5.5.tar.gz) = 33228

View File

@ -0,0 +1,56 @@
Index: src/fts-backend-xapian-functions.cpp
--- src/fts-backend-xapian-functions.cpp.orig
+++ src/fts-backend-xapian-functions.cpp
@@ -506,10 +506,15 @@ static long fts_backend_xapian_current_time()
static long fts_backend_xapian_get_free_memory() // KB
{
struct rlimit rl;
+
+#if !defined(__OpenBSD__)
getrlimit(RLIMIT_AS,&rl);
long limit = rl.rlim_cur / 1024.0;
if(fts_xapian_settings.verbose>1) i_warning("FTS Xapian: RLIM AS =%ld",limit);
+#else
+ long limit = 0;
+#endif
getrlimit(RLIMIT_DATA,&rl);
long l2 = rl.rlim_cur / 1024.0;
@@ -517,7 +522,7 @@ static long fts_backend_xapian_get_free_memory() // KB
if((l2>0) && ((limit>l2) || (limit<1))) limit=l2;
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
uint32_t m;
size_t len = sizeof(m);
sysctlbyname("vm.stats.vm.v_free_count", &m, &len, NULL, 0);
Index: src/fts-backend-xapian-functions.cpp
--- src/fts-backend-xapian-functions.cpp.orig
+++ src/fts-backend-xapian-functions.cpp
@@ -506,10 +506,15 @@ static long fts_backend_xapian_current_time()
static long fts_backend_xapian_get_free_memory() // KB
{
struct rlimit rl;
+
+#if !defined(__OpenBSD__)
getrlimit(RLIMIT_AS,&rl);
long limit = rl.rlim_cur / 1024.0;
if(fts_xapian_settings.verbose>1) i_warning("FTS Xapian: RLIM AS =%ld",limit);
+#else
+ long limit = 0;
+#endif
getrlimit(RLIMIT_DATA,&rl);
long l2 = rl.rlim_cur / 1024.0;
@@ -517,7 +522,7 @@ static long fts_backend_xapian_get_free_memory() // KB
if((l2>0) && ((limit>l2) || (limit<1))) limit=l2;
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
uint32_t m;
size_t len = sizeof(m);
sysctlbyname("vm.stats.vm.v_free_count", &m, &len, NULL, 0);

View File

@ -0,0 +1,24 @@
Index: src/fts-xapian-plugin.c
--- src/fts-xapian-plugin.c.orig
+++ src/fts-xapian-plugin.c
@@ -35,7 +35,7 @@ static void fts_xapian_mail_user_created(struct mail_u
fuser->set.partial = XAPIAN_DEFAULT_PARTIAL;
fuser->set.full = XAPIAN_DEFAULT_FULL;
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
size_t len = sizeof(fuser->set.pagesize);
sysctlbyname("hw.pagesize", &(fuser->set.pagesize), &len, NULL, 0);
#else
Index: src/fts-xapian-plugin.c
--- src/fts-xapian-plugin.c.orig
+++ src/fts-xapian-plugin.c
@@ -35,7 +35,7 @@ static void fts_xapian_mail_user_created(struct mail_u
fuser->set.partial = XAPIAN_DEFAULT_PARTIAL;
fuser->set.full = XAPIAN_DEFAULT_FULL;
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
size_t len = sizeof(fuser->set.pagesize);
sysctlbyname("hw.pagesize", &(fuser->set.pagesize), &len, NULL, 0);
#else

View File

@ -0,0 +1,24 @@
Index: src/fts-xapian-plugin.h
--- src/fts-xapian-plugin.h.orig
+++ src/fts-xapian-plugin.h
@@ -16,7 +16,7 @@
#include "module-context.h"
#include "fts-api-private.h"
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
#include <sys/types.h>
#include <sys/sysctl.h>
#if !defined(__APPLE__)
Index: src/fts-xapian-plugin.h
--- src/fts-xapian-plugin.h.orig
+++ src/fts-xapian-plugin.h
@@ -16,7 +16,7 @@
#include "module-context.h"
#include "fts-api-private.h"
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
#include <sys/types.h>
#include <sys/sysctl.h>
#if !defined(__APPLE__)