mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Bug#51770: UNINSTALL PLUGIN requires no privileges
The problem was that UNINSTALL PLUGIN wasn't performing privilege checks before removing a plugin. Any user (including users without any kind of privileges) could uninstall any plugin. The solution is to verify if the user has the DELETE privilege for the mysql.plugin table before uninstalling a plugin.
This commit is contained in:
20
mysql-test/t/plugin_not_embedded.test
Normal file
20
mysql-test/t/plugin_not_embedded.test
Normal file
@@ -0,0 +1,20 @@
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_example_plugin.inc
|
||||
|
||||
--echo #
|
||||
--echo # Bug#51770: UNINSTALL PLUGIN requires no privileges
|
||||
--echo #
|
||||
|
||||
GRANT INSERT ON mysql.plugin TO bug51770@localhost;
|
||||
connect(con1,localhost,bug51770,,);
|
||||
eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO;
|
||||
--error ER_TABLEACCESS_DENIED_ERROR
|
||||
UNINSTALL PLUGIN example;
|
||||
connection default;
|
||||
GRANT DELETE ON mysql.plugin TO bug51770@localhost;
|
||||
FLUSH PRIVILEGES;
|
||||
connection con1;
|
||||
UNINSTALL PLUGIN example;
|
||||
disconnect con1;
|
||||
connection default;
|
||||
DROP USER bug51770@localhost;
|
||||
Reference in New Issue
Block a user