summaryrefslogtreecommitdiff
path: root/client/mysqlslap.c
diff options
context:
space:
mode:
authorGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2012-07-05 09:55:20 +0300
committerGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2012-07-05 09:55:20 +0300
commit31a9208bd09afd16ce540be2cd66c7059b7bdeb8 (patch)
tree79bc42ec937ff1b148e0a6b66924d7a3d796b805 /client/mysqlslap.c
parente6f0b97b50bd2267ef7fdb8c8ec80ae5a4c62dc2 (diff)
downloadmariadb-git-31a9208bd09afd16ce540be2cd66c7059b7bdeb8.tar.gz
Bug #12998841: libmysql divulges plaintext password upon request in 5.5
1. Clear text password client plugin disabled by default. 2. Added an environment variable LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN, that when set to something starting with '1', 'Y' or 'y' will enable the clear text plugin for all connections. 3. Added a new mysql_options() option : MYSQL_ENABLE_CLEARTEXT_PLUGIN that takes an my_bool argument. When the value of the argument is non-zero the clear text plugin is enabled for this connection only. 4. Added an enable-cleartext-plugin config file option that takes a numeric argument. If the numeric value of the numeric argument is non-zero the clear text plugin is enabled for the connection 5. Added a boolean command line option "--enable_cleartext_plugin" to mysql, mysqlslap and mysqladmin. When specified it will call mysql_options with the effect of #3 6. Added a new CLEARTEXT option to the connect command in mysqltest. When specified it will enable the cleartext plugin for usage. 7. Added test cases and updated existing ones that need the clear text plugin.
Diffstat (limited to 'client/mysqlslap.c')
-rw-r--r--client/mysqlslap.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index a2c01b85b5a..ac1cc31733c 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -125,6 +125,8 @@ static char *host= NULL, *opt_password= NULL, *user= NULL,
*post_system= NULL,
*opt_mysql_unix_port= NULL;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
+static uint opt_enable_cleartext_plugin= 0;
+static my_bool using_opt_enable_cleartext_plugin= 0;
const char *delimiter= "\n";
@@ -348,6 +350,9 @@ int main(int argc, char **argv)
if (opt_default_auth && *opt_default_auth)
mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
+ if (using_opt_enable_cleartext_plugin)
+ mysql_options(&mysql, MYSQL_ENABLE_CLEARTEXT_PLUGIN,
+ (char*) &opt_enable_cleartext_plugin);
if (!opt_only_print)
{
if (!(mysql_real_connect(&mysql, host, user, opt_password,
@@ -603,6 +608,10 @@ static struct my_option my_long_options[] =
"Detach (close and reopen) connections after X number of requests.",
&detach_rate, &detach_rate, 0, GET_UINT, REQUIRED_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},
{"engine", 'e', "Storage engine to use for creating the table.",
&default_engine, &default_engine, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -761,6 +770,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case 'I': /* Info */
usage();
exit(0);
+ case OPT_ENABLE_CLEARTEXT_PLUGIN:
+ using_opt_enable_cleartext_plugin= TRUE;
+ break;
}
DBUG_RETURN(0);
}