aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorohauer <ohauer@FreeBSD.org>2018-03-01 05:50:21 +0800
committerohauer <ohauer@FreeBSD.org>2018-03-01 05:50:21 +0800
commit868ba265759de44c6258c0a3ee64391a2f626658 (patch)
treeb714a14d1b2365bb5378501f68329e9c86b1bf4f /mail
parentfc8b490ca1eb3ac74f40e216e34563f868eccca0 (diff)
downloadfreebsd-ports-gnome-868ba265759de44c6258c0a3ee64391a2f626658.tar.gz
freebsd-ports-gnome-868ba265759de44c6258c0a3ee64391a2f626658.tar.zst
freebsd-ports-gnome-868ba265759de44c6258c0a3ee64391a2f626658.zip
- fix build agains maraidb100 [1]
Firt definition of MARIADB_VERSION_ID can be found in mariadb102 therefore we have to use MARIADB_BASE_VERSION which is defined in mariadb55 and mariadb10x PR: 226266 [1], 220224 Reported by: Zilon [1]
Diffstat (limited to 'mail')
-rw-r--r--mail/postfix-current/files/patch-src_global_dict__mysql.c47
1 files changed, 40 insertions, 7 deletions
diff --git a/mail/postfix-current/files/patch-src_global_dict__mysql.c b/mail/postfix-current/files/patch-src_global_dict__mysql.c
index c33b3a403f78..e2f43056e446 100644
--- a/mail/postfix-current/files/patch-src_global_dict__mysql.c
+++ b/mail/postfix-current/files/patch-src_global_dict__mysql.c
@@ -7,16 +7,49 @@
#
--- src/global/dict_mysql.c.orig 2017-02-19 01:58:20 UTC
+++ src/global/dict_mysql.c
-@@ -656,7 +656,11 @@ static void plmysql_connect_single(DICT_
+@@ -198,6 +198,15 @@
+
+ #include "dict_mysql.h"
+
++/* MySQL 8.x API change */
++
++#if MYSQL_VERSION_ID >= 80000 && !defined(MARIADB_BASE_VERSION)
++#define DICT_MYSQL_SSL_VERIFY_SERVER_CERT MYSQL_OPT_SSL_MODE
++#elif MYSQL_VERSION_ID >= 50023
++#define DICT_MYSQL_SSL_VERIFY_SERVER_CERT MYSQL_OPT_SSL_VERIFY_SERVER_CERT
++#endif
++
++
+ /* need some structs to help organize things */
+ typedef struct {
+ MYSQL *db;
+@@ -237,7 +246,7 @@ typedef struct {
+ char *tls_CAfile;
+ char *tls_CApath;
+ char *tls_ciphers;
+-#if MYSQL_VERSION_ID >= 50023
++#if defined(DICT_MYSQL_SSL_VERIFY_SERVER_CERT)
+ int tls_verify_cert;
+ #endif
+ #endif
+@@ -656,9 +665,9 @@ static void plmysql_connect_single(DICT_
dict_mysql->tls_key_file, dict_mysql->tls_cert_file,
dict_mysql->tls_CAfile, dict_mysql->tls_CApath,
dict_mysql->tls_ciphers);
-#if MYSQL_VERSION_ID >= 50023
-+#if MYSQL_VERSION_ID >= 80000 && !defined(MARIADB_VERSION_ID)
-+ if (dict_mysql->tls_verify_cert != -1)
-+ mysql_options(host->db, MYSQL_OPT_SSL_MODE,
-+ &dict_mysql->tls_verify_cert);
-+#elif MYSQL_VERSION_ID >= 50023
++#if defined(DICT_MYSQL_SSL_VERIFY_SERVER_CERT)
if (dict_mysql->tls_verify_cert != -1)
- mysql_options(host->db, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
+- mysql_options(host->db, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
++ mysql_options(host->db, DICT_MYSQL_SSL_VERIFY_SERVER_CERT,
&dict_mysql->tls_verify_cert);
+ #endif
+ #endif
+@@ -723,7 +732,7 @@ static void mysql_parse_config(DICT_MYSQ
+ dict_mysql->tls_CAfile = cfg_get_str(p, "tls_CAfile", NULL, 0, 0);
+ dict_mysql->tls_CApath = cfg_get_str(p, "tls_CApath", NULL, 0, 0);
+ dict_mysql->tls_ciphers = cfg_get_str(p, "tls_ciphers", NULL, 0, 0);
+-#if MYSQL_VERSION_ID >= 50023
++#if defined(DICT_MYSQL_SSL_VERIFY_SERVER_CERT)
+ dict_mysql->tls_verify_cert = cfg_get_bool(p, "tls_verify_cert", -1);
+ #endif
+ #endif