Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
10.1.16
-
None
-
Redhat Linux 6.7
Description
There is a simple parser bug in the grant function when granting database privileges to a role
In this grant statement for a role this code works, however a simple change renders it broken
GRANT ALL PRIVILEGES ON `logging`.* TO 'developer' |
to
GRANT ALL PRIVILEGES ON `logging`.`*` TO 'developer' |
This breaks the grant
example
MariaDB [(none)]> show grants;
|
+-----------------------------------------------------------------------------------------------------------------+
|
| Grants for pmclarty@192.168.% |
|
+-----------------------------------------------------------------------------------------------------------------+
|
| GRANT developer TO 'pmclarty'@'192.168.%' |
|
| GRANT USAGE ON *.* TO 'pmclarty'@'192.168.%' IDENTIFIED BY PASSWORD '*7C5EB1AB3838C67932450CCDA5FFC43F00237D6A' |
|
| GRANT USAGE ON *.* TO 'developer' |
|
| GRANT ALL PRIVILEGES ON `logging`.* TO 'developer' |
|
+-----------------------------------------------------------------------------------------------------------------+
|
4 rows in set (0.00 sec)
|
|
MariaDB [(none)]> revoke ALL PRIVILEGES on `logging`.* from developer;
|
ERROR 1044 (42000): Access denied for user 'pmclarty'@'192.168.%' to database 'logging'
|
MariaDB [(none)]> grant ALL PRIVILEGES on `logging`.`*` to developer;
|
ERROR 1142 (42000): SELECT, INSERT, UPDATE, DELETE, command denied to user 'pmclarty'@'192.168.71.175' for table '*'
|
MariaDB [(none)]> exit
|
Bye
|
PS H:\> mysql -h host1_dbt -upmclarty -p
|
Enter password: ********
|
Welcome to the MariaDB monitor. Commands end with ; or \g.
|
Your MariaDB connection id is 6
|
Server version: 10.1.16-MariaDB MariaDB Server
|
|
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
|
|
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
|
|
MariaDB [(none)]> show grants;
|
+-----------------------------------------------------------------------------------------------------------------+
|
| Grants for pmclarty@192.168.% |
|
+-----------------------------------------------------------------------------------------------------------------+
|
| GRANT developer TO 'pmclarty'@'192.168.%' |
|
| GRANT USAGE ON *.* TO 'pmclarty'@'192.168.%' IDENTIFIED BY PASSWORD '*7C5EB1AB3838C67932450CCDA5FFC43F00237D6A' |
|
| GRANT USAGE ON *.* TO 'developer' |
|
| GRANT ALL PRIVILEGES ON `logging`.`*` TO 'developer' |
|
+-----------------------------------------------------------------------------------------------------------------+
|
4 rows in set (0.00 sec)
|
|
MariaDB [(none)]> use logging;
|
Database changed
|
MariaDB [logging]> show tables;
|
Empty set (0.00 sec)
|
|
MariaDB [logging]>
|