New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cyrus-imapd: depends on obsolete pcre library #3861
Comments
|
This is deeply confusing but I think I have finally understood...
Is that a correct summation of the situation? There's more detail in the linked Debian bug, but I want to make sure I'm clear on the basics before I try reading any deeper |
|
Hi @elliefm, thanks for the translation and sorry for this : I'm not fluent in English. You are totally right here |
|
Your English is fine, it was the version number going backwards that was the confusing part! :) |
|
Sure, sorry. Is this just a test issue or a core issue ? |
|
No idea yet. But I think it's reasonable to assume that if our tests are doing something the new library doesn't like, then our real code is probably also doing it and will also break. |
|
@brong does this sound like the same issue you mentioned on the Cyrus conf call the other day? |
|
Just as a "heads up": Fedora also tries to get rid of the old pcre, which is meanwhile even end-of-life at upstream, in favor of pcre2; see also: https://bugzilla.redhat.com/show_bug.cgi?id=2128286 |
|
Same for ArchLinux: https://bugs.archlinux.org/task/77058#comment214212 |
diff --git a/configure.ac b/configure.ac
index 8fe7d78..ac601a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -666,7 +666,7 @@ AM_CONDITIONAL([SQUATTER],
AC_ARG_ENABLE(sieve,
[AS_HELP_STRING([--disable-sieve], [disable Sieve support])],,[enable_sieve="yes";])
AC_ARG_ENABLE(pcre,
- [AS_HELP_STRING([--disable-pcre], [disable PCRE library])],[cyrus_cv_pcre_utf8="$enableval"])
+ [AS_HELP_STRING([--disable-pcre2], [disable PCRE library])],[cyrus_cv_pcre_utf8="$enableval"])
if test "$enable_sieve" != "no"; then
AC_DEFINE(USE_SIEVE,[],[Build in Sieve support?])
@@ -692,25 +692,25 @@ fi
AM_CONDITIONAL([SIEVE], [test "${enable_sieve}" != "no"])
-if test "$enable_pcre" != "no"; then
- AC_CHECK_HEADER(pcreposix.h)
- if test "$ac_cv_header_pcreposix_h" = "yes"; then
- AC_MSG_CHECKING(for utf8 enabled pcre)
- AC_CACHE_VAL(cyrus_cv_pcre_utf8, AC_TRY_CPP([#include <pcreposix.h>
-#ifndef REG_UTF8
+if test "$enable_pcre2" != "no"; then
+ AC_CHECK_HEADER(pcre2posix.h)
+ if test "$ac_cv_header_pcre2posix_h" = "yes"; then
+ AC_MSG_CHECKING(for utf8 enabled pcre2)
+ AC_CACHE_VAL(cyrus_cv_pcre_utf8, AC_TRY_CPP([#include <pcre2posix.h>
+#ifndef REG_UTF
#include </nonexistent>
-#endif],cyrus_cv_pcre_utf8=yes,cyrus_cv_pcre_utf8=no))
- AC_MSG_RESULT($cyrus_cv_pcre_utf8)
+#endif],cyrus_cv_pcre2_utf8=yes,cyrus_cv_pcre2_utf8=no))
+ AC_MSG_RESULT($cyrus_cv_pcre2_utf8)
else
- cyrus_cv_pcre_utf8="no"
+ cyrus_cv_pcre2_utf8="no"
fi
fi
LIB_REGEX=
-if test "$cyrus_cv_pcre_utf8" = "yes"; then
- LIB_REGEX="-lpcre -lpcreposix";
+if test "$cyrus_cv_pcre2_utf8" = "yes"; then
+ LIB_REGEX="-lpcre2-posix";
AC_DEFINE(ENABLE_REGEX, [], [Do we have a regex library?])
- AC_DEFINE(HAVE_PCREPOSIX_H, [], [Do we have usable pcre library?])
+ AC_DEFINE(HAVE_PCRE2POSIX_H, [], [Do we have usable pcre2 library?])
else
AC_CHECK_HEADERS(rxposix.h)
if test "$ac_cv_header_rxposix_h" = "yes"; then
diff --git a/imap/cyr_buildinfo.c b/imap/cyr_buildinfo.c
index d8c4a96..c2db3b0 100644
--- a/imap/cyr_buildinfo.c
+++ b/imap/cyr_buildinfo.c
@@ -181,7 +181,7 @@ static json_t *buildinfo()
#else
json_object_set_new(dependency, "jansson", json_false());
#endif
-#if defined(ENABLE_REGEX) && defined(HAVE_PCREPOSIX_H)
+#if defined(ENABLE_REGEX) && defined(HAVE_PCRE2POSIX_H)
json_object_set_new(dependency, "pcre", json_true());
#else
json_object_set_new(dependency, "pcre", json_false());
diff --git a/lib/util.h b/lib/util.h
index 6ac085c..dbeef25 100644
--- a/lib/util.h
+++ b/lib/util.h
@@ -71,16 +71,17 @@
extern const char CYRUS_VERSION[];
#ifdef ENABLE_REGEX
-# ifdef HAVE_PCREPOSIX_H
-# include <pcre.h>
-# include <pcreposix.h>
-# else /* !HAVE_PCREPOSIX_H */
+# if defined(HAVE_PCRE2POSIX_H) && !defined(PCRE2_CODE_UNIT_WIDTH)
+# define PCRE2_CODE_UNIT_WIDTH 8
+# include <pcre2.h>
+# include <pcre2posix.h>
+# elif !defined(HAVE_PCRE2POSIX_H) /* !HAVE_PCRE2POSIX_H */
# ifdef HAVE_RXPOSIX_H
# include <rxposix.h>
# else /* !HAVE_RXPOSIX_H */
# include <regex.h>
# endif /* HAVE_RXPOSIX_H */
-# endif /* HAVE_PCREPOSIX_H */
+# endif /* HAVE_PCRE2POSIX_H */
#endif /* ENABLE_REGEX */
#ifdef HAVE_LIBUUID
diff --git a/sieve/bc_eval.c b/sieve/bc_eval.c
index f14a5d7..9c3d67c 100644
--- a/sieve/bc_eval.c
+++ b/sieve/bc_eval.c
@@ -316,9 +316,9 @@ static int regcomp_flags(int comparator, int requires)
{
int cflags = REG_EXTENDED;
-#ifdef HAVE_PCREPOSIX_H
+#ifdef HAVE_PCRE2POSIX_H
/* support UTF8 comparisons */
- cflags |= REG_UTF8;
+ cflags |= REG_UTF;
#endif
if (comparator == B_ASCIICASEMAP) {
diff --git a/sieve/comparator.h b/sieve/comparator.h
index b043bc2..8ff05b0 100644
--- a/sieve/comparator.h
+++ b/sieve/comparator.h
@@ -47,16 +47,17 @@
#include <sys/types.h>
#ifdef ENABLE_REGEX
-# ifdef HAVE_PCREPOSIX_H
-# include <pcre.h>
-# include <pcreposix.h>
-# else /* !HAVE_PCREPOSIX_H */
+# if defined(HAVE_PCRE2POSIX_H) && !defined(PCRE2_CODE_UNIT_WIDTH)
+# define PCRE2_CODE_UNIT_WIDTH 8
+# include <pcre2.h>
+# include <pcre2posix.h>
+# elif !defined(HAVE_PCRE2POSIX_H) /* !HAVE_PCRE2POSIX_H */
# ifdef HAVE_RXPOSIX_H
# include <rxposix.h>
# else /* !HAVE_RXPOSIX_H */
# include <regex.h>
# endif /* HAVE_RXPOSIX_H */
-# endif /* HAVE_PCREPOSIX_H */
+# endif /* HAVE_PCRE2POSIX_H */
#endif /* ENABLE_REGEX */
#include "sieve_interface.h"
diff --git a/sieve/sieve.y b/sieve/sieve.y
index b080c26..8692fc1 100644
--- a/sieve/sieve.y
+++ b/sieve/sieve.y
@@ -2215,9 +2215,9 @@ static int verify_regexlist(sieve_script_t *sscript,
regex_t reg;
int cflags = REG_EXTENDED | REG_NOSUB;
-#ifdef HAVE_PCREPOSIX_H
+#ifdef HAVE_PCRE2POSIX_H
/* support UTF8 comparisons */
- cflags |= REG_UTF8;
+ cflags |= REG_UTF;
#endif
if (collation == B_ASCIICASEMAP) { |
|
I’m not sure whether @loqs intended to post the patch without comments, but if you read the Arch ticket linked above, you will see they figured out that this one (plus removing |
Classic pcre is unmaintained and being dropped from distributions. Fixes: cyrusimap#3861 Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Classic pcre is unmaintained and being dropped from distributions. pcre2posix.h is missing idempotent guards, so handle that ourselves. Fixes: cyrusimap#3861 Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Ref: https://bugs.debian.org/1000034
Hi,
when using pcre2, all test passed except this one:
which gives:
Cheers,
Yadd
The text was updated successfully, but these errors were encountered: