Accepting request 545886 from home:kstreitova:branches:server:mail

- add exim-4.86.2-mariadb_102_compile_fix.patch to fix compilation
   with the mariadb 10.2 (in our case the build with libmariadb
   library from the mariadb-connector-c package)
   * upstream commits: a12400fd4493b676e71613ab429e731f777ebd1e and
   31beb7972466a33a88770eacbce13490f2ddadc2

OBS-URL: https://build.opensuse.org/request/show/545886
OBS-URL: https://build.opensuse.org/package/show/server:mail/exim?expand=0&rev=193
This commit is contained in:
Dirk Mueller 2017-11-27 09:56:51 +00:00 committed by Git OBS Bridge
parent 8ca7e168f0
commit 51dac3bc71
3 changed files with 105 additions and 0 deletions

View File

@ -0,0 +1,94 @@
Index: exim-4.86.2/src/lookups/mysql.c
===================================================================
--- exim-4.86.2.orig/src/lookups/mysql.c
+++ exim-4.86.2/src/lookups/mysql.c
@@ -14,6 +14,53 @@ functions. */
#include <mysql.h> /* The system header */
+/* We define symbols for *_VERSION_ID (numeric), *_VERSION_STR (char*)
+and *_BASE_STR (char*). It's a bit of guesswork. Especially for mariadb
+with versions before 10.2, as they do not define there there specific symbols.
+*/
+
+// Newer (>= 10.2) MariaDB
+#if defined MARIADB_VERSION_ID
+#define EXIM_MxSQL_VERSION_ID MARIADB_VERSION_ID
+
+// MySQL defines MYSQL_VERSION_ID, and MariaDB does so
+// https://dev.mysql.com/doc/refman/5.7/en/c-api-server-client-versions.html
+#elif defined LIBMYSQL_VERSION_ID
+#define EXIM_MxSQL_VERSION_ID LIBMYSQL_VERSION_ID
+#elif defined MYSQL_VERSION_ID
+#define EXIM_MxSQL_VERSION_ID MYSQL_VERSION_ID
+
+#else
+#define EXIM_MYSQL_VERSION_ID 0
+#endif
+
+// Newer (>= 10.2) MariaDB
+#ifdef MARIADB_CLIENT_VERSION_STR
+#define EXIM_MxSQL_VERSION_STR MARIADB_CLIENT_VERSION_STR
+
+// Mysql uses MYSQL_SERVER_VERSION
+#elif defined LIBMYSQL_VERSION
+#define EXIM_MxSQL_VERSION_STR LIBMYSQL_VERSION
+#elif defined MYSQL_SERVER_VERSION
+#define EXIM_MxSQL_VERSION_STR MYSQL_SERVER_VERSION
+
+#else
+#define EXIM_MxSQL_VERSION_STR "N.A."
+#endif
+
+#if defined MARIADB_BASE_VERSION
+#define EXIM_MxSQL_BASE_STR MARIADB_BASE_VERSION
+
+#elif defined MARIADB_PACKAGE_VERSION
+#define EXIM_MxSQL_BASE_STR "mariadb"
+
+#elif defined MYSQL_BASE_VERSION
+#define EXIM_MxSQL_BASE_STR MYSQL_BASE_VERSION
+
+#else
+#define EXIM_MxSQL_BASE_STR "n.A."
+#endif
+
/* Structure and anchor for caching connections. */
@@ -423,10 +470,10 @@ return quoted;
void
mysql_version_report(FILE *f)
{
-fprintf(f, "Library version: MySQL: Compile: %s [%s]\n"
- " Runtime: %s\n",
- MYSQL_SERVER_VERSION, MYSQL_COMPILATION_COMMENT,
- mysql_get_client_info());
+fprintf(f, "Library version: MySQL: Compile: %lu %s [%s]\n"
+ " Runtime: %lu %s\n",
+ (long)EXIM_MxSQL_VERSION_ID, EXIM_MxSQL_VERSION_STR, EXIM_MxSQL_BASE_STR,
+ mysql_get_client_version(), mysql_get_client_info());
#ifdef DYNLOOKUP
fprintf(f, " Exim version %s\n", EXIM_VERSION_STR);
#endif
Index: exim-4.86.2/src/EDITME
===================================================================
--- exim-4.86.2.orig/src/EDITME
+++ exim-4.86.2/src/EDITME
@@ -253,7 +253,7 @@ TRANSPORT_SMTP=yes
# you perform upgrades and revert them. You should consider the benefit of
# embedding the Exim version number into LOOKUP_MODULE_DIR, so that you can
# maintain two concurrent sets of modules.
-#
+#
# *BEWARE*: ability to modify the files in LOOKUP_MODULE_DIR is equivalent to
# the ability to modify the Exim binary, which is often setuid root! The Exim
# developers only intend this functionality be used by OS software packagers
@@ -301,6 +301,7 @@ LOOKUP_DNSDB=yes
# LOOKUP_IBASE=yes
# LOOKUP_LDAP=yes
# LOOKUP_MYSQL=yes
+# LOOKUP_MYSQL_PC=mariadb
# LOOKUP_NIS=yes
# LOOKUP_NISPLUS=yes
# LOOKUP_ORACLE=yes

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Mon Nov 27 08:52:33 UTC 2017 - kstreitova@suse.com
- add exim-4.86.2-mariadb_102_compile_fix.patch to fix compilation
with the mariadb 10.2 (in our case the build with libmariadb
library from the mariadb-connector-c package)
* upstream commits: a12400fd4493b676e71613ab429e731f777ebd1e and
31beb7972466a33a88770eacbce13490f2ddadc2
-------------------------------------------------------------------
Thu Nov 23 13:43:04 UTC 2017 - rbrown@suse.com

View File

@ -111,6 +111,7 @@ Patch0: exim-tail.patch
Patch1: exim-4.86.2+fixes-867e8fe25dbfb1e31493488ad695bde55b890397.patch
Patch2: fix-CVE-2016-9963-31c02defdc5118834e801d4fe8f11c1d9b5ebadf.patch
Patch3: exim-CVE-2017-1000369.patch
Patch4: exim-4.86.2-mariadb_102_compile_fix.patch
%package -n eximon
Summary: Eximon, an graphical frontend to administer Exim's mail queue
@ -156,6 +157,7 @@ once, if at all. The rest is done by logrotate / cron.)
%patch1 -p 1
%patch2 -p 1
%patch3 -p 1
%patch4 -p 1
# build with fPIE/pie on SUSE 10.0 or newer, or on any other platform
%if %{?suse_version:%suse_version}%{?!suse_version:99999} > 930
fPIE="-fPIE"