From eb60e24b91b98c7dff545de3540558bde80d077e Mon Sep 17 00:00:00 2001 From: TmsKtel Date: Wed, 15 Aug 2018 12:59:45 +0200 Subject: [PATCH] Add enable cleartext plugin option to binlog reader --- client/mysqlbinlog.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 9531f6aa09b..241a5c51b95 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -318,6 +318,8 @@ static int port = 0; static uint my_end_arg; static const char *sock = 0; static char *opt_plugin_dir = 0, *opt_default_auth = 0; +static uint opt_enable_cleartext_plugin = 0; +static bool using_opt_enable_cleartext_plugin = 0; #if defined(_WIN32) static char *shared_memory_base_name = 0; @@ -1593,6 +1595,10 @@ static struct my_option my_long_options[] = { {"print-table-metadata", OPT_PRINT_TABLE_METADATA, "Print metadata stored in Table_map_log_event", &opt_print_table_metadata, &opt_print_table_metadata, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"enable_cleartext_plugin", OPT_ENABLE_CLEARTEXT_PLUGIN, + "Enable/disable the clear text authentication plugin.", + &opt_enable_cleartext_plugin, &opt_enable_cleartext_plugin, 0, GET_BOOL, + OPT_ARG, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}}; /** @@ -1802,6 +1808,9 @@ extern "C" bool get_one_option(int optid, const struct my_option *opt, warning(CLIENT_WARN_DEPRECATED_MSG("--stop-never-slave-server-id", "--connection-server-id")); break; + case OPT_ENABLE_CLEARTEXT_PLUGIN: + using_opt_enable_cleartext_plugin = true; + break; } if (tty_password) pass = get_tty_password(NullS); @@ -1840,6 +1849,10 @@ static Exit_status safe_connect() { return ERROR_STOP; } + if (using_opt_enable_cleartext_plugin) + mysql_options(mysql, MYSQL_ENABLE_CLEARTEXT_PLUGIN, + (char *)&opt_enable_cleartext_plugin); + SSL_SET_OPTIONS(mysql); if (opt_plugin_dir && *opt_plugin_dir)