summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2018-05-08 15:08:08 +0100
committerVladislav Vaintroub <wlad@mariadb.com>2018-05-08 19:52:08 +0000
commitf98496da969ed2b65f944f11ac11163030bc44b1 (patch)
tree533a0adbd11df4bc80e3d147b9367aab2303f146
parentb62224e232fedf982598aa4b373962c4c3746400 (diff)
downloadmariadb-git-f98496da969ed2b65f944f11ac11163030bc44b1.tar.gz
MDEV-16105: Mariabackup does not support SSL
The reason is the missing HAVE_OPENSSL define for mariabackup.
-rw-r--r--extra/mariabackup/CMakeLists.txt2
-rw-r--r--extra/mariabackup/backup_mysql.cc2
-rw-r--r--extra/mariabackup/xtrabackup.cc16
-rw-r--r--mysql-test/suite/mariabackup/backup_ssl.result9
-rw-r--r--mysql-test/suite/mariabackup/backup_ssl.test16
5 files changed, 36 insertions, 9 deletions
diff --git a/extra/mariabackup/CMakeLists.txt b/extra/mariabackup/CMakeLists.txt
index 0e6336fe5e6..aa05b36153f 100644
--- a/extra/mariabackup/CMakeLists.txt
+++ b/extra/mariabackup/CMakeLists.txt
@@ -52,7 +52,7 @@ ELSE()
SET(NT_SERVICE_SOURCE)
ENDIF()
-ADD_DEFINITIONS(-DPCRE_STATIC=1)
+ADD_DEFINITIONS(-DPCRE_STATIC=1 -DHAVE_OPENSSL=1)
MYSQL_ADD_EXECUTABLE(mariabackup
xtrabackup.cc
diff --git a/extra/mariabackup/backup_mysql.cc b/extra/mariabackup/backup_mysql.cc
index 661992a1696..7f0ad8a8361 100644
--- a/extra/mariabackup/backup_mysql.cc
+++ b/extra/mariabackup/backup_mysql.cc
@@ -91,7 +91,7 @@ time_t history_lock_time;
MYSQL *mysql_connection;
-my_bool opt_ssl_verify_server_cert;
+extern my_bool opt_ssl_verify_server_cert, opt_use_ssl;
MYSQL *
xb_mysql_connect()
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index 867e7869fcf..84f57bde64f 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -203,6 +203,10 @@ static ulong max_buf_pool_modified_pct;
/* Ignored option (--log) for MySQL option compatibility */
char* log_ignored_opt = NULL;
+
+extern my_bool opt_use_ssl;
+my_bool opt_ssl_verify_server_cert;
+
/* === metadata of backup === */
#define XTRABACKUP_METADATA_FILENAME "xtrabackup_checkpoints"
char metadata_type[30] = ""; /*[full-backuped|log-applied|
@@ -360,9 +364,6 @@ uint opt_safe_slave_backup_timeout = 0;
const char *opt_history = NULL;
-#if defined(HAVE_OPENSSL)
-my_bool opt_ssl_verify_server_cert = FALSE;
-#endif
/* Whether xtrabackup_binlog_info should be created on recovery */
static bool recover_binlog_info;
@@ -453,6 +454,7 @@ typedef struct {
} data_thread_ctxt_t;
/* ======== for option and variables ======== */
+#include <../../client/client_priv.h>
enum options_xtrabackup
{
@@ -528,8 +530,6 @@ enum options_xtrabackup
OPT_INNODB_LOG_CHECKSUM_ALGORITHM,
OPT_XTRA_INCREMENTAL_FORCE_SCAN,
OPT_DEFAULTS_GROUP,
- OPT_OPEN_FILES_LIMIT,
- OPT_PLUGIN_DIR,
OPT_PLUGIN_LOAD,
OPT_INNODB_ENCRYPT_LOG,
OPT_CLOSE_FILES,
@@ -915,9 +915,9 @@ struct my_option xb_client_options[] =
{"secure-auth", OPT_XB_SECURE_AUTH, "Refuse client connecting to server if it"
" uses old (pre-4.1.1) protocol.", &opt_secure_auth,
&opt_secure_auth, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
-
+#define MYSQL_CLIENT
#include "sslopt-longopts.h"
-
+#undef MYSQL_CLIENT
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -1388,7 +1388,9 @@ xb_get_one_option(int optid,
}
}
break;
+#define MYSQL_CLIENT
#include "sslopt-case.h"
+#undef MYSQL_CLIENT
case '?':
usage();
diff --git a/mysql-test/suite/mariabackup/backup_ssl.result b/mysql-test/suite/mariabackup/backup_ssl.result
new file mode 100644
index 00000000000..6e59da6d43a
--- /dev/null
+++ b/mysql-test/suite/mariabackup/backup_ssl.result
@@ -0,0 +1,9 @@
+GRANT ALL PRIVILEGES on *.* TO backup_user IDENTIFIED by 'x' REQUIRE SSL;
+FLUSH PRIVILEGES;
+# xtrabackup backup
+# xtrabackup prepare
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart server
+DROP USER backup_user;
diff --git a/mysql-test/suite/mariabackup/backup_ssl.test b/mysql-test/suite/mariabackup/backup_ssl.test
new file mode 100644
index 00000000000..e858c834d29
--- /dev/null
+++ b/mysql-test/suite/mariabackup/backup_ssl.test
@@ -0,0 +1,16 @@
+GRANT ALL PRIVILEGES on *.* TO backup_user IDENTIFIED by 'x' REQUIRE SSL;
+FLUSH PRIVILEGES;
+echo # xtrabackup backup;
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --user=backup_user --password=x --ssl --backup --target-dir=$targetdir;
+--enable_result_log
+
+echo # xtrabackup prepare;
+--disable_result_log
+exec $XTRABACKUP --prepare --target-dir=$targetdir;
+-- source include/restart_and_restore.inc
+--enable_result_log
+DROP USER backup_user;
+rmdir $targetdir;
+