diff options
author | Staale Smedseng <staale.smedseng@sun.com> | 2010-04-22 15:52:00 +0200 |
---|---|---|
committer | Staale Smedseng <staale.smedseng@sun.com> | 2010-04-22 15:52:00 +0200 |
commit | 20c9177518c3bb07c74df9fa8e25ba46af60f484 (patch) | |
tree | 97a0fc74fbdab86d5760f344f5e2bd773b203d26 /sql/sql_plugin.cc | |
parent | 4859951a900b687f55f8ca3ac786bbec200fcc90 (diff) | |
download | mariadb-git-20c9177518c3bb07c74df9fa8e25ba46af60f484.tar.gz |
Bug#46261 Plugins can be installed with --skip-grant-tables
Previously installed dynamic plugins are explicitly not loaded
on startup with --skip-grant-tables enabled. However, INSTALL
PLUGIN/UNINSTALL PLUGIN commands are allowed, and result in
inconsistent error messages (reporting duplicate plugin or
plugin does not exist).
This patch adds a check for --skip-grant-tables mode, and
returns error ER_OPTION_PREVENTS_STATEMENT to the user when
the above commands are attempted.
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r-- | sql/sql_plugin.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 87c0adc3133..94a2b506207 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1665,6 +1665,12 @@ bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING *dl struct st_plugin_int *tmp; DBUG_ENTER("mysql_install_plugin"); + if (opt_noacl) + { + my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables"); + DBUG_RETURN(TRUE); + } + bzero(&tables, sizeof(tables)); tables.db= (char *)"mysql"; tables.table_name= tables.alias= (char *)"plugin"; @@ -1741,6 +1747,12 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name) struct st_plugin_int *plugin; DBUG_ENTER("mysql_uninstall_plugin"); + if (opt_noacl) + { + my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables"); + DBUG_RETURN(TRUE); + } + bzero(&tables, sizeof(tables)); tables.db= (char *)"mysql"; tables.table_name= tables.alias= (char *)"plugin"; |