|
1 | 1 | /* |
2 | | - Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. |
| 2 | + Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. |
3 | 3 |
|
4 | 4 | This program is free software; you can redistribute it and/or modify |
5 | 5 | it under the terms of the GNU General Public License as published by |
@@ -43,6 +43,8 @@ static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0, |
43 | 43 | opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0, |
44 | 44 | opt_write_binlog= 1, opt_secure_auth=TRUE; |
45 | 45 | static uint verbose = 0, opt_mysql_port=0; |
| 46 | +static uint opt_enable_cleartext_plugin= 0; |
| 47 | +static my_bool using_opt_enable_cleartext_plugin= 0; |
46 | 48 | static int my_end_arg; |
47 | 49 | static char * opt_mysql_unix_port = 0; |
48 | 50 | static char *opt_password = 0, *current_user = 0, |
@@ -116,6 +118,10 @@ static struct my_option my_long_options[] = |
116 | 118 | "Default authentication client-side plugin to use.", |
117 | 119 | &opt_default_auth, &opt_default_auth, 0, |
118 | 120 | GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
| 121 | + {"enable_cleartext_plugin", OPT_ENABLE_CLEARTEXT_PLUGIN, |
| 122 | + "Enable/disable the clear text authentication plugin.", |
| 123 | + &opt_enable_cleartext_plugin, &opt_enable_cleartext_plugin, |
| 124 | + 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, |
119 | 125 | {"fast",'F', "Check only tables that haven't been closed properly.", |
120 | 126 | &opt_fast, &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, |
121 | 127 | 0}, |
@@ -338,6 +344,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), |
338 | 344 | verbose++; |
339 | 345 | break; |
340 | 346 | case 'V': print_version(); exit(0); |
| 347 | + case OPT_ENABLE_CLEARTEXT_PLUGIN: |
| 348 | + using_opt_enable_cleartext_plugin= TRUE; |
| 349 | + break; |
341 | 350 | case OPT_MYSQL_PROTOCOL: |
342 | 351 | opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, |
343 | 352 | opt->name); |
@@ -907,6 +916,10 @@ static int dbConnect(char *host, char *user, char *passwd) |
907 | 916 | if (opt_default_auth && *opt_default_auth) |
908 | 917 | mysql_options(&mysql_connection, MYSQL_DEFAULT_AUTH, opt_default_auth); |
909 | 918 |
|
| 919 | + if (using_opt_enable_cleartext_plugin) |
| 920 | + mysql_options(&mysql_connection, MYSQL_ENABLE_CLEARTEXT_PLUGIN, |
| 921 | + (char *) &opt_enable_cleartext_plugin); |
| 922 | + |
910 | 923 | mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset); |
911 | 924 | mysql_options(&mysql_connection, MYSQL_OPT_CONNECT_ATTR_RESET, 0); |
912 | 925 | mysql_options4(&mysql_connection, MYSQL_OPT_CONNECT_ATTR_ADD, |
|
0 commit comments