diff options
author | Ting Nian <tingynia@amazon.com> | 2022-05-03 17:25:48 +0000 |
---|---|---|
committer | Daniel Black <daniel@mariadb.org> | 2022-05-26 14:21:23 +1000 |
commit | 31e30329a368a32d9de202748987592cc86db241 (patch) | |
tree | 9ecca0e634f6e7ae47a3b35aeda75121fbeeb210 /client/mysql.cc | |
parent | f85d488ad2132db7b294cde3909cb5992b752143 (diff) | |
download | mariadb-git-31e30329a368a32d9de202748987592cc86db241.tar.gz |
Add option --enable-cleartext-plugin to the MariaDB client
For compatibility reasons, add the option to the MariaDB client without
any functional changes besides simply accepting the option and emitting
a warning that it is obsolete.
In MySQL this security related option is compulsory in certain use
cases. When users switch to MariaDB, this client command that used to
work starts failing without a sensible error message. In worst case
users resort to re-installing the mysql client from MySQL.
In MariaDB the option is obsolete and should simply be ignored. Users
however don't have any opportunity to learn that unless the client
program tells them so.
Before:
mysql --enable-cleartext-plugin ...
mysql: unknown option '--enable-cleartext-plugin'
(program terminates)
After:
mysql --enable-cleartext-plugin ...
WARNING: option '--enable-cleartext-plugin' is obsolete.
(program executes)
All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services, Inc.
Diffstat (limited to 'client/mysql.cc')
-rw-r--r-- | client/mysql.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index 558b54e3909..ea92c84e1d1 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1521,6 +1521,8 @@ static struct my_option my_long_options[] = &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"execute", 'e', "Execute command and quit. (Disables --force and history file.)", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"enable-cleartext-plugin", OPT_COMPATIBILTY_CLEARTEXT_PLUGIN, "Obsolete option. Exists only for MySQL compatibility.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"vertical", 'E', "Print the output of a query (rows) vertically.", &vertical, &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -1817,6 +1819,14 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), printf("WARNING: --server-arg option not supported in this configuration.\n"); #endif break; + case OPT_COMPATIBILTY_CLEARTEXT_PLUGIN: + /* + This option exists in MySQL client but not in MariaDB. Users switching from + MySQL might still have this option in their commands, and it will not work + in MariaDB unless it is handled. Therefore output a warning and continue. + */ + printf("WARNING: option '--enable-cleartext-plugin' is obsolete.\n"); + break; case 'A': opt_rehash= 0; break; |