pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/databases/mysql56-client databases/mysql56-client: all...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f0bb723c56e1
branches:  trunk
changeset: 339097:f0bb723c56e1
user:      taca <taca%pkgsrc.org@localhost>
date:      Fri Sep 06 10:01:44 2019 +0000

description:
databases/mysql56-client: allow build with OpenSSL 1.1.x

* Allow mysql56-{client,server} build with OpenSSL 1.1.x.
* Reduce a few useless warnings.

diffstat:

 databases/mysql56-client/distinfo                                      |   11 +-
 databases/mysql56-client/patches/patch-include_m__string.h             |   16 +
 databases/mysql56-client/patches/patch-include_my_net.h                |   21 +-
 databases/mysql56-client/patches/patch-mysys__ssl_my__aes__openssl.cc  |  118 ++++++++++
 databases/mysql56-client/patches/patch-sql_mysqld.cc                   |   42 +++
 databases/mysql56-client/patches/patch-sql_rpl__slave.cc               |   39 +++
 databases/mysql56-client/patches/patch-storage_innobase_include_univ.i |   16 +
 databases/mysql56-client/patches/patch-vio_vio.c                       |   17 +
 databases/mysql56-client/patches/patch-vio_viosslfactories.c           |   44 +++
 9 files changed, 317 insertions(+), 7 deletions(-)

diffs (truncated from 399 to 300 lines):

diff -r a49008d99094 -r f0bb723c56e1 databases/mysql56-client/distinfo
--- a/databases/mysql56-client/distinfo Fri Sep 06 09:58:36 2019 +0000
+++ b/databases/mysql56-client/distinfo Fri Sep 06 10:01:44 2019 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.52 2019/08/06 06:55:15 adam Exp $
+$NetBSD: distinfo,v 1.53 2019/09/06 10:01:44 taca Exp $
 
 SHA1 (mysql-5.6.45.tar.gz) = f42901c8d52297912da4978ec9422458cff72071
 RMD160 (mysql-5.6.45.tar.gz) = c711161babd1b8f9b7f96d88264a468972a83a0b
@@ -22,19 +22,23 @@
 SHA1 (patch-cmd-line-utils_libedit_chartype.h) = 6b1453df648001ed1fc81190106e15872a69a04c
 SHA1 (patch-cmd-line-utils_libedit_vi.c) = 7c5ce1d07f650815d028e435a59e5d078ec74c2f
 SHA1 (patch-include_CMakeLists.txt) = 49d351a958e63c69ad8bfe5c50961fe3751e86c4
+SHA1 (patch-include_m__string.h) = 1622466a65c61a4ab0838bd80f6c24c061407eaf
 SHA1 (patch-include_my__global.h) = 843b9527faf880eee59cf02239ba601f5985ddfb
 SHA1 (patch-include_my_compare.h) = f45bac4b488332a668b0005751856279b67401f5
-SHA1 (patch-include_my_net.h) = b08aa36921efd023f9ecaac4cd3fb8a16d200abd
+SHA1 (patch-include_my_net.h) = 8d97e4396fd1df095798fca79cc07daffff449d3
 SHA1 (patch-include_my_pthread.h) = ff3bf1fddd04edd7804d810f79de64387464b5ca
 SHA1 (patch-libmysql_CMakeLists.txt) = 229044de6d11b26ee99b25be99b628a9f146b795
 SHA1 (patch-mysql-test_CMakeLists.txt) = b7dd562d55678b13ac487aa0ee59bf2551af1f9d
 SHA1 (patch-mysys__ssl_CMakeLists.txt) = e50bad459520be78ea2d5c4d0699cda8c1141884
+SHA1 (patch-mysys__ssl_my__aes__openssl.cc) = c6bcab27d992f90f7929cb697a7c7565671ebb6f
 SHA1 (patch-mysys_stacktrace.c) = 27ddd012c9ca299cfe2b9935b9f99fe603415e7e
 SHA1 (patch-scripts_CMakeLists.txt) = 5b44d2d137e3e64474d663a8faab5b5f289f4cf5
 SHA1 (patch-scripts_mysql__install__db.pl.in) = c2ed1705a530a0f2dfb8325496ceb7e2a9c98185
 SHA1 (patch-scripts_mysqld_safe.sh) = 0784314227657aa0bc3f4a0b4e21c173a86fa94b
 SHA1 (patch-sql_CMakeLists.txt) = 83c1e50de6b53a0af5ff010f248dd595745b3eb5
 SHA1 (patch-sql_log_event.h) = a413038ffa29103c75e1d243864615ccb3d9621e
+SHA1 (patch-sql_mysqld.cc) = 953ea6b1178e5d139446bc45a96730a9de9051e3
+SHA1 (patch-sql_rpl__slave.cc) = cc231060d7b8c1efe230c324fb7dfee90b058589
 SHA1 (patch-sql_sql_string.h) = 1ce4d4db59310ea45e384f34e33c0d61935059bf
 SHA1 (patch-sql_sys__vars.cc) = 355b17dac8da6f94c9996ae406df304113a1f8f5
 SHA1 (patch-storage_archive_CMakeLists.txt) = e739ef4884a154d7e33e8aae24234fd6855119b7
@@ -43,7 +47,10 @@
 SHA1 (patch-storage_example_CMakeLists.txt) = a80b1dd3c6020b3fe958db35bebe3bd181136f0d
 SHA1 (patch-storage_federated_CMakeLists.txt) = f809504bad63129a06ce455b49ee40cca940891e
 SHA1 (patch-storage_heap_CMakeLists.txt) = 0a1a5a7b5e83f14cec43bfa4782dd4bb7b629347
+SHA1 (patch-storage_innobase_include_univ.i) = eb305029b8529cab88c80d75821fc9940e0f6b0b
 SHA1 (patch-storage_myisam_CMakeLists.txt) = 55897ae78208f78a396776d1082cb5f98631fff8
 SHA1 (patch-storage_myisammrg_CMakeLists.txt) = 0a56a16ccaff3fa9de996fec6ffc324af9855a4e
 SHA1 (patch-storage_ndb_include_util_Parser.hpp) = 037fc153619bf79ee95cb03a5ac4a71c14952c3a
 SHA1 (patch-strings_decimal.c) = 069c9d930c735f74510702baa9bef38aec425903
+SHA1 (patch-vio_vio.c) = 33914d1a3c8d9c7b4b83ba0b9be97c007137a7cd
+SHA1 (patch-vio_viosslfactories.c) = 0ec8e17abb5419f49a9fc803c374da70306b5e3a
diff -r a49008d99094 -r f0bb723c56e1 databases/mysql56-client/patches/patch-include_m__string.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/databases/mysql56-client/patches/patch-include_m__string.h        Fri Sep 06 10:01:44 2019 +0000
@@ -0,0 +1,16 @@
+$NetBSD: patch-include_m__string.h,v 1.1 2019/09/06 10:01:44 taca Exp $
+
+* Stop useless warnings.
+
+--- include/m_string.h.orig    2019-06-10 10:25:32.000000000 +0000
++++ include/m_string.h
+@@ -43,7 +43,9 @@
+ #endif
+ 
+ #define bfill please_use_memset_rather_than_bfill()
++#ifndef bzero
+ #define bzero please_use_memset_rather_than_bzero()
++#endif
+ 
+ #if !defined(HAVE_MEMCPY) && !defined(HAVE_MEMMOVE)
+ # define memcpy(d, s, n)      bcopy ((s), (d), (n))
diff -r a49008d99094 -r f0bb723c56e1 databases/mysql56-client/patches/patch-include_my_net.h
--- a/databases/mysql56-client/patches/patch-include_my_net.h   Fri Sep 06 09:58:36 2019 +0000
+++ b/databases/mysql56-client/patches/patch-include_my_net.h   Fri Sep 06 10:01:44 2019 +0000
@@ -1,10 +1,11 @@
-$NetBSD: patch-include_my_net.h,v 1.1 2013/02/13 21:00:04 adam Exp $
-
-Define SHUT_RDWR for Irix 5.
+$NetBSD: patch-include_my_net.h,v 1.2 2019/09/06 10:01:44 taca Exp $
 
---- include/my_net.h.orig      2013-01-22 16:54:49.000000000 +0000
+* Define SHUT_RDWR for Irix 5.
+* Stop useless warnings.
+
+--- include/my_net.h.orig      2019-06-10 10:25:32.000000000 +0000
 +++ include/my_net.h
-@@ -70,6 +70,15 @@ C_MODE_START
+@@ -70,14 +70,25 @@ C_MODE_START
  #include <netdb.h>     /* getaddrinfo() & co */
  #endif
  
@@ -20,3 +21,13 @@
  /*
    On OSes which don't have the in_addr_t, we guess that using uint32 is the best
    possible choice. We guess this from the fact that on HP-UX64bit & FreeBSD64bit
+   & Solaris64bit, in_addr_t is equivalent to uint32. And on Linux32bit too.
+ */
+ #ifndef HAVE_IN_ADDR_T
++#ifndef in_addr_t
+ #define in_addr_t uint32
+ #endif
++#endif
+ 
+ 
+ C_MODE_END
diff -r a49008d99094 -r f0bb723c56e1 databases/mysql56-client/patches/patch-mysys__ssl_my__aes__openssl.cc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/databases/mysql56-client/patches/patch-mysys__ssl_my__aes__openssl.cc     Fri Sep 06 10:01:44 2019 +0000
@@ -0,0 +1,118 @@
+$NetBSD: patch-mysys__ssl_my__aes__openssl.cc,v 1.1 2019/09/06 10:01:44 taca Exp $
+
+* Allow build with OpenSSL 1.1.
+
+--- mysys_ssl/my_aes_openssl.cc.orig   2019-06-10 10:25:32.000000000 +0000
++++ mysys_ssl/my_aes_openssl.cc
+@@ -108,33 +108,46 @@ int my_aes_encrypt(const unsigned char *
+                    const unsigned char *key, uint32 key_length,
+                    enum my_aes_opmode mode, const unsigned char *iv)
+ {
+-  EVP_CIPHER_CTX ctx;
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++  EVP_CIPHER_CTX stack_ctx;
++  EVP_CIPHER_CTX *ctx= &stack_ctx;
++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */
++  EVP_CIPHER_CTX *ctx= EVP_CIPHER_CTX_new();
++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+   const EVP_CIPHER *cipher= aes_evp_type(mode);
+   int u_len, f_len;
+   /* The real key to be used for encryption */
+   unsigned char rkey[MAX_AES_KEY_LENGTH / 8];
+   my_aes_create_key(key, key_length, rkey, mode);
+ 
+-  if (!cipher || (EVP_CIPHER_iv_length(cipher) > 0 && !iv))
++  if (!ctx || !cipher || (EVP_CIPHER_iv_length(cipher) > 0 && !iv))
+     return MY_AES_BAD_DATA;
+ 
+-  if (!EVP_EncryptInit(&ctx, cipher, rkey, iv))
++  if (!EVP_EncryptInit(ctx, cipher, rkey, iv))
+     goto aes_error;                             /* Error */
+-  if (!EVP_CIPHER_CTX_set_padding(&ctx, 1))
++  if (!EVP_CIPHER_CTX_set_padding(ctx, 1))
+     goto aes_error;                             /* Error */
+-  if (!EVP_EncryptUpdate(&ctx, dest, &u_len, source, source_length))
++  if (!EVP_EncryptUpdate(ctx, dest, &u_len, source, source_length))
+     goto aes_error;                             /* Error */
+ 
+-  if (!EVP_EncryptFinal(&ctx, dest + u_len, &f_len))
++  if (!EVP_EncryptFinal(ctx, dest + u_len, &f_len))
+     goto aes_error;                             /* Error */
+ 
+-  EVP_CIPHER_CTX_cleanup(&ctx);
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++  EVP_CIPHER_CTX_cleanup(ctx);
++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */
++  EVP_CIPHER_CTX_free(ctx);
++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+   return u_len + f_len;
+ 
+ aes_error:
+   /* need to explicitly clean up the error if we want to ignore it */
+   ERR_clear_error();
+-  EVP_CIPHER_CTX_cleanup(&ctx);
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++    EVP_CIPHER_CTX_cleanup(ctx);
++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */
++    EVP_CIPHER_CTX_free(ctx);
++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+   return MY_AES_BAD_DATA;
+ }
+ 
+@@ -145,7 +158,12 @@ int my_aes_decrypt(const unsigned char *
+                    enum my_aes_opmode mode, const unsigned char *iv)
+ {
+ 
+-  EVP_CIPHER_CTX ctx;
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++  EVP_CIPHER_CTX stack_ctx;
++  EVP_CIPHER_CTX *ctx= &stack_ctx;
++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */
++  EVP_CIPHER_CTX *ctx= EVP_CIPHER_CTX_new();
++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+   const EVP_CIPHER *cipher= aes_evp_type(mode);
+   int u_len, f_len;
+ 
+@@ -153,27 +171,33 @@ int my_aes_decrypt(const unsigned char *
+   unsigned char rkey[MAX_AES_KEY_LENGTH / 8];
+ 
+   my_aes_create_key(key, key_length, rkey, mode);
+-  if (!cipher || (EVP_CIPHER_iv_length(cipher) > 0 && !iv))
++  if (!ctx || !cipher || (EVP_CIPHER_iv_length(cipher) > 0 && !iv))
+     return MY_AES_BAD_DATA;
+ 
+-  EVP_CIPHER_CTX_init(&ctx);
+-
+-  if (!EVP_DecryptInit(&ctx, aes_evp_type(mode), rkey, iv))
++  if (!EVP_DecryptInit(ctx, aes_evp_type(mode), rkey, iv))
+     goto aes_error;                             /* Error */
+-  if (!EVP_CIPHER_CTX_set_padding(&ctx, 1))
++  if (!EVP_CIPHER_CTX_set_padding(ctx, 1))
+     goto aes_error;                             /* Error */
+-  if (!EVP_DecryptUpdate(&ctx, dest, &u_len, source, source_length))
++  if (!EVP_DecryptUpdate(ctx, dest, &u_len, source, source_length))
+     goto aes_error;                             /* Error */
+-  if (!EVP_DecryptFinal_ex(&ctx, dest + u_len, &f_len))
++  if (!EVP_DecryptFinal_ex(ctx, dest + u_len, &f_len))
+     goto aes_error;                             /* Error */
+ 
+-  EVP_CIPHER_CTX_cleanup(&ctx);
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++  EVP_CIPHER_CTX_cleanup(ctx);
++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */
++  EVP_CIPHER_CTX_free(ctx);
++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+   return u_len + f_len;
+ 
+ aes_error:
+   /* need to explicitly clean up the error if we want to ignore it */
+   ERR_clear_error();
+-  EVP_CIPHER_CTX_cleanup(&ctx);
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++  EVP_CIPHER_CTX_cleanup(ctx);
++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */
++  EVP_CIPHER_CTX_free(ctx);
++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+   return MY_AES_BAD_DATA;
+ }
+ 
diff -r a49008d99094 -r f0bb723c56e1 databases/mysql56-client/patches/patch-sql_mysqld.cc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/databases/mysql56-client/patches/patch-sql_mysqld.cc      Fri Sep 06 10:01:44 2019 +0000
@@ -0,0 +1,42 @@
+$NetBSD: patch-sql_mysqld.cc,v 1.5 2019/09/06 10:01:44 taca Exp $
+
+* Allow build with OpenSSL 1.1.
+
+--- sql/mysqld.cc.orig 2019-06-10 10:25:32.000000000 +0000
++++ sql/mysqld.cc
+@@ -2759,9 +2759,9 @@ bool one_thread_per_connection_end(THD *
+   }
+ 
+   // Clean up errors now, before possibly waiting for a new connection.
+-#ifndef EMBEDDED_LIBRARY
+-  ERR_remove_state(0);
+-#endif
++#if !defined(EMBEDDED_LIBRARY) && OPENSSL_VERSION_NUMBER < 0x10100000L
++  ERR_remove_thread_state(0);
++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+ 
+   delete thd;
+ 
+@@ -4358,7 +4358,11 @@ static int init_ssl()
+ {
+ #ifdef HAVE_OPENSSL
+ #ifndef HAVE_YASSL
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+   CRYPTO_malloc_init();
++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */
++  OPENSSL_malloc_init();
++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+ #endif
+   ssl_start();
+ #ifndef EMBEDDED_LIBRARY
+@@ -4372,7 +4376,9 @@ static int init_ssl()
+                                         opt_ssl_cipher, &error,
+                                           opt_ssl_crl, opt_ssl_crlpath);
+     DBUG_PRINT("info",("ssl_acceptor_fd: 0x%lx", (long) ssl_acceptor_fd));
+-    ERR_remove_state(0);
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++    ERR_remove_thread_state(0);
++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+     if (!ssl_acceptor_fd)
+     {
+       sql_print_warning("Failed to setup SSL");
diff -r a49008d99094 -r f0bb723c56e1 databases/mysql56-client/patches/patch-sql_rpl__slave.cc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/databases/mysql56-client/patches/patch-sql_rpl__slave.cc  Fri Sep 06 10:01:44 2019 +0000
@@ -0,0 +1,39 @@
+$NetBSD: patch-sql_rpl__slave.cc,v 1.3 2019/09/06 10:01:44 taca Exp $
+
+* Allow build with OpenSSL 1.1.
+
+--- sql/rpl_slave.cc.orig      2019-06-10 10:25:32.000000000 +0000
++++ sql/rpl_slave.cc
+@@ -5143,7 +5143,9 @@ err:
+   mysql_mutex_unlock(&mi->run_lock);
+   DBUG_LEAVE;                                   // Must match DBUG_ENTER()
+   my_thread_end();
+-  ERR_remove_state(0);
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++  ERR_remove_thread_state(0);
++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+   pthread_exit(0);
+   return(0);                                    // Avoid compiler warnings
+ }
+@@ -5334,7 +5336,9 @@ err:
+   }
+ 
+   my_thread_end();
+-  ERR_remove_state(0);
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++  ERR_remove_thread_state(0);
++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+   pthread_exit(0);
+   DBUG_RETURN(0); 
+ }
+@@ -6482,7 +6486,9 @@ log '%s' at position %s, relay log '%s' 



Home | Main Index | Thread Index | Old Index