summaryrefslogtreecommitdiff
path: root/mysql-test/r/grant_lowercase_fs.result
diff options
context:
space:
mode:
authorSergey Glukhov <Sergey.Glukhov@sun.com>2009-10-27 12:09:19 +0400
committerSergey Glukhov <Sergey.Glukhov@sun.com>2009-10-27 12:09:19 +0400
commit58b7761ed85079dc3edb69467feb060ae810cabe (patch)
tree589000e4e1ea7d7e67c786f815e59fa5d67371b2 /mysql-test/r/grant_lowercase_fs.result
parentdd02c4a12b1c210d65dbf940e0d5b59aa65b6326 (diff)
downloadmariadb-git-58b7761ed85079dc3edb69467feb060ae810cabe.tar.gz
Bug#41049 does syntax "grant" case insensitive?
Problem 1: column_priv_hash uses utf8_general_ci collation for the key comparison. The key consists of user name, db name and table name. Thus user with privileges on table t1 is able to perform the same operation on T1 (the similar situation with user name & db name, see acl_cache). So collation which is used for column_priv_hash and acl_cache should be case sensitive. The fix: replace system_charset_info with my_charset_utf8_bin for column_priv_hash and acl_cache Problem 2: The same situation with proc_priv_hash, func_priv_hash, the only difference is that Routine name is case insensitive. So the fix is to use my_charset_utf8_bin for proc_priv_hash & func_priv_hash and convert routine name into lower case before writing the element into the hash and before looking up the key. Additional fix: mysql.procs_priv Routine_name field collation is changed to utf8_general_ci. It's necessary for REVOKE command (to find a field by routine hash element values). Note: It's safe for lower-case-table-names mode too because db name & table name are converted into lower case (see GRANT_NAME::GRANT_NAME).
Diffstat (limited to 'mysql-test/r/grant_lowercase_fs.result')
-rw-r--r--mysql-test/r/grant_lowercase_fs.result16
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/r/grant_lowercase_fs.result b/mysql-test/r/grant_lowercase_fs.result
new file mode 100644
index 00000000000..5a3087ed5cd
--- /dev/null
+++ b/mysql-test/r/grant_lowercase_fs.result
@@ -0,0 +1,16 @@
+create database db1;
+GRANT CREATE ON db1.* to user_1@localhost;
+GRANT SELECT ON db1.* to USER_1@localhost;
+CREATE TABLE t1(f1 int);
+SELECT * FROM t1;
+ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't1'
+SELECT * FROM t1;
+f1
+CREATE TABLE t2(f1 int);
+ERROR 42000: CREATE command denied to user 'USER_1'@'localhost' for table 't2'
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM user_1@localhost;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM USER_1@localhost;
+DROP USER user_1@localhost;
+DROP USER USER_1@localhost;
+DROP DATABASE db1;
+use test;