User manager add grants bug

[expired user #5522]'s profile image [expired user #5522] posted 13 years ago in General Permalink
HeidiSQL 6.0.0.3914
add grants for db information_schema

show grants for test;

GRANT SELECT ON `information\_schema`.* TO 'test'@'%'
unhappy
ansgar's profile image ansgar posted 13 years ago Permalink
Looks perfect. Where's the bug?
[expired user #5522]'s profile image [expired user #5522] posted 13 years ago Permalink
We add the grants through the user manager for db 'test_test'

show grants for test;
GRANT SELECT ON `test\_test`.* TO 'test'@'%'



query: GRANT SELECT ON `test_test`.* TO 'test'@'%'

show grants for test;
GRANT SELECT ON `test\_test`.* TO 'test'@'%'
GRANT SELECT ON `test_test`.* TO 'test'@'%'
For what to use backslash?
ansgar's profile image ansgar posted 13 years ago Permalink
The backslash is important!

Without that backslash...
GRANT SELECT ON `test_test`.* TO 'test'@'%'

... the user cannot only access the "test_test" database, but also "testAtest", or "testotest". The underscore is a wildcard for exactly one character. If you escape that underscore with a backslash (like HeidiSQL does it), you just give the privilege to exactly the wanted database.

Now, to make it a bit more complicated: The dialog for selecting a database, table or column contains a text box at the bottom. If the user now really needs to access all databases beginning with "test_", HeidiSQL allows you to do that in this text box, without escaped wildcards.
[expired user #5522]'s profile image [expired user #5522] posted 13 years ago Permalink
it is a feature... thanks smile

Please login to leave a reply, or register at first.