summaryrefslogtreecommitdiff
path: root/mysql-test/t/plugin_auth.test
diff options
context:
space:
mode:
authorGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2010-09-20 16:51:42 +0300
committerGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2010-09-20 16:51:42 +0300
commit9fee5866beed47b55c5196acfa1a03503a13a2d7 (patch)
tree13371c3b85b4becf45b52726f26faed48f002453 /mysql-test/t/plugin_auth.test
parent5564e0837f8d6811acd6f8dc0369ec96dcab3c54 (diff)
downloadmariadb-git-9fee5866beed47b55c5196acfa1a03503a13a2d7.tar.gz
Bug #56798 : Wrong credentials assigned when using a proxy user.
Fixed incorrect handling of user credentials when authenticating via proxy user. Now the server will use the proxies user's access mask and host to update the security context runtime structure when logging in. Fixed a compilation warning with the embedded library. Fixed a crash when doing a second GRANT PROXY on ''@'' due to incomplete equality check logic.
Diffstat (limited to 'mysql-test/t/plugin_auth.test')
-rw-r--r--mysql-test/t/plugin_auth.test34
1 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/t/plugin_auth.test b/mysql-test/t/plugin_auth.test
index f5a8bd416a0..77dcd7add73 100644
--- a/mysql-test/t/plugin_auth.test
+++ b/mysql-test/t/plugin_auth.test
@@ -296,3 +296,37 @@ disconnect plug_con;
DROP USER plug;
DROP USER plug_dest;
--echo ## END @@external_user tests
+
+--echo #
+--echo # Bug #56798 : Wrong credentials assigned when using a proxy user.
+--echo #
+
+GRANT ALL PRIVILEGES ON *.* TO power_user;
+GRANT USAGE ON anonymous_db.* TO ''@''
+ IDENTIFIED WITH 'test_plugin_server' AS 'power_user';
+GRANT PROXY ON power_user TO ''@'';
+CREATE DATABASE confidential_db;
+
+connect(plug_con,localhost, test_login_user, power_user, confidential_db);
+SELECT user(),current_user(),@@proxy_user;
+
+connection default;
+disconnect plug_con;
+
+DROP USER power_user;
+DROP USER ''@'';
+DROP DATABASE confidential_db;
+
+--echo # Test case #2 (crash with double grant proxy)
+
+CREATE USER ''@'' IDENTIFIED WITH 'test_plugin_server' AS 'standard_user';
+CREATE USER standard_user;
+CREATE DATABASE shared;
+GRANT ALL PRIVILEGES ON shared.* TO standard_user;
+GRANT PROXY ON standard_user TO ''@'';
+--echo #should not crash
+GRANT PROXY ON standard_user TO ''@'';
+
+DROP USER ''@'';
+DROP USER standard_user;
+DROP DATABASE shared;