summaryrefslogtreecommitdiff
path: root/mysql-test/t/grant2.test
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2003-07-22 22:21:23 +0200
committerunknown <serg@serg.mylan>2003-07-22 22:21:23 +0200
commit1cf4eea19d870f9e6fe147ec36b7df0eef1514cf (patch)
tree0eec29de18641195250ca526517244f6f0b0e820 /mysql-test/t/grant2.test
parentb413e5c420c3cdb32b519f67aaacf7ad1126d71e (diff)
downloadmariadb-git-1cf4eea19d870f9e6fe147ec36b7df0eef1514cf.tar.gz
now GRANT db.* ... compares patterns correctly to prevent privilege escalation
Diffstat (limited to 'mysql-test/t/grant2.test')
-rw-r--r--mysql-test/t/grant2.test18
1 files changed, 6 insertions, 12 deletions
diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test
index d1535fa17a9..3fbe2b0fe58 100644
--- a/mysql-test/t/grant2.test
+++ b/mysql-test/t/grant2.test
@@ -15,22 +15,16 @@ grant all privileges on `my\_%`.* to mysqltest_1@localhost with grant option;
connect (user1,localhost,mysqltest_1,,);
connection user1;
select current_user();
+grant all privileges on `my\_1`.* to mysqltest_2@localhost with grant option;
--error 1044
-grant all privileges on `my\_1`.* to mysqltest_9@localhost with grant option;
-grant all privileges on `my_%`.* to mysqltest_2@localhost with grant option;
+grant all privileges on `my_%`.* to mysqltest_3@localhost with grant option;
disconnect user1;
-connect (user2,localhost,mysqltest_2,,);
-connection user2;
-select current_user();
-grant all privileges on `mysql`.* to mysqltest_3@localhost with grant option;
-disconnect user2;
-connect (user3,localhost,mysqltest_3,,);
-connection user3;
-select current_user();
-show grants for mysqltest_3@localhost;
-disconnect user3;
connect (root,localhost,root,,);
connection root;
+show grants for mysqltest_1@localhost;
+show grants for mysqltest_2@localhost;
+--error 1141
+show grants for mysqltest_3@localhost;
delete from mysql.user where user like 'mysqltest\_%';
delete from mysql.db where user like 'mysqltest\_%';
flush privileges;