Commit f98496da authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-16105: Mariabackup does not support SSL

The reason is the missing HAVE_OPENSSL define for mariabackup.
parent b62224e2
...@@ -52,7 +52,7 @@ ELSE() ...@@ -52,7 +52,7 @@ ELSE()
SET(NT_SERVICE_SOURCE) SET(NT_SERVICE_SOURCE)
ENDIF() ENDIF()
ADD_DEFINITIONS(-DPCRE_STATIC=1) ADD_DEFINITIONS(-DPCRE_STATIC=1 -DHAVE_OPENSSL=1)
MYSQL_ADD_EXECUTABLE(mariabackup MYSQL_ADD_EXECUTABLE(mariabackup
xtrabackup.cc xtrabackup.cc
......
...@@ -91,7 +91,7 @@ time_t history_lock_time; ...@@ -91,7 +91,7 @@ time_t history_lock_time;
MYSQL *mysql_connection; MYSQL *mysql_connection;
my_bool opt_ssl_verify_server_cert; extern my_bool opt_ssl_verify_server_cert, opt_use_ssl;
MYSQL * MYSQL *
xb_mysql_connect() xb_mysql_connect()
......
...@@ -203,6 +203,10 @@ static ulong max_buf_pool_modified_pct; ...@@ -203,6 +203,10 @@ static ulong max_buf_pool_modified_pct;
/* Ignored option (--log) for MySQL option compatibility */ /* Ignored option (--log) for MySQL option compatibility */
char* log_ignored_opt = NULL; char* log_ignored_opt = NULL;
extern my_bool opt_use_ssl;
my_bool opt_ssl_verify_server_cert;
/* === metadata of backup === */ /* === metadata of backup === */
#define XTRABACKUP_METADATA_FILENAME "xtrabackup_checkpoints" #define XTRABACKUP_METADATA_FILENAME "xtrabackup_checkpoints"
char metadata_type[30] = ""; /*[full-backuped|log-applied| char metadata_type[30] = ""; /*[full-backuped|log-applied|
...@@ -360,9 +364,6 @@ uint opt_safe_slave_backup_timeout = 0; ...@@ -360,9 +364,6 @@ uint opt_safe_slave_backup_timeout = 0;
const char *opt_history = NULL; 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 */ /* Whether xtrabackup_binlog_info should be created on recovery */
static bool recover_binlog_info; static bool recover_binlog_info;
...@@ -453,6 +454,7 @@ typedef struct { ...@@ -453,6 +454,7 @@ typedef struct {
} data_thread_ctxt_t; } data_thread_ctxt_t;
/* ======== for option and variables ======== */ /* ======== for option and variables ======== */
#include <../../client/client_priv.h>
enum options_xtrabackup enum options_xtrabackup
{ {
...@@ -528,8 +530,6 @@ enum options_xtrabackup ...@@ -528,8 +530,6 @@ enum options_xtrabackup
OPT_INNODB_LOG_CHECKSUM_ALGORITHM, OPT_INNODB_LOG_CHECKSUM_ALGORITHM,
OPT_XTRA_INCREMENTAL_FORCE_SCAN, OPT_XTRA_INCREMENTAL_FORCE_SCAN,
OPT_DEFAULTS_GROUP, OPT_DEFAULTS_GROUP,
OPT_OPEN_FILES_LIMIT,
OPT_PLUGIN_DIR,
OPT_PLUGIN_LOAD, OPT_PLUGIN_LOAD,
OPT_INNODB_ENCRYPT_LOG, OPT_INNODB_ENCRYPT_LOG,
OPT_CLOSE_FILES, OPT_CLOSE_FILES,
...@@ -915,9 +915,9 @@ struct my_option xb_client_options[] = ...@@ -915,9 +915,9 @@ struct my_option xb_client_options[] =
{"secure-auth", OPT_XB_SECURE_AUTH, "Refuse client connecting to server if it" {"secure-auth", OPT_XB_SECURE_AUTH, "Refuse client connecting to server if it"
" uses old (pre-4.1.1) protocol.", &opt_secure_auth, " uses old (pre-4.1.1) protocol.", &opt_secure_auth,
&opt_secure_auth, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, &opt_secure_auth, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
#define MYSQL_CLIENT
#include "sslopt-longopts.h" #include "sslopt-longopts.h"
#undef MYSQL_CLIENT
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} { 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, ...@@ -1388,7 +1388,9 @@ xb_get_one_option(int optid,
} }
} }
break; break;
#define MYSQL_CLIENT
#include "sslopt-case.h" #include "sslopt-case.h"
#undef MYSQL_CLIENT
case '?': case '?':
usage(); usage();
......
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;
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;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment