[MXS-3172] Database grants with escape characters do not work (strip_db_esc) Created: 2020-09-10 Updated: 2020-10-26 Resolved: 2020-10-26 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | mariadbclient |
| Affects Version/s: | 2.5.3 |
| Fix Version/s: | 2.5.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Anthony | Assignee: | Esa Korhonen |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Environment: |
Percona XtraDB cluster 5.7.29 |
||
| Sprint: | MXS-SPRINT-117 |
| Description |
|
Dear all, Since the migration to Maxscale 2.4 -> 2.5 (worked well in 2.4), we cannot connect to any database via mysql command: SELECT permissions has been added to tables_priv & columns_priv also. Not added for roles_mapping because this table doesn't exist with Percona. Maxscale logs (with info):
Maxscale conf:
Best regards, |
| Comments |
| Comment by markus makela [ 2020-09-11 ] | ||||||||||
|
Can you show the grants for that user? Looks like a missing grant on the test database. | ||||||||||
| Comment by Anthony [ 2020-09-11 ] | ||||||||||
|
Dear @markus, You can find here the grants:
Test user:
Please note that the DB name has been sanitized in this ticket. (the original name contain XX_XX (with underscore) instead test name) | ||||||||||
| Comment by markus makela [ 2020-09-11 ] | ||||||||||
|
Can you create a reproducible test case that we can try? | ||||||||||
| Comment by Anthony [ 2020-09-11 ] | ||||||||||
|
Here an example (password included): MySQL cli on Percona directly:
MySQL cli on Maxscale:
MySQL grants:
Best regards, | ||||||||||
| Comment by markus makela [ 2020-09-11 ] | ||||||||||
|
Thanks for the test case, we'll see if we can reproduce it. | ||||||||||
| Comment by markus makela [ 2020-10-12 ] | ||||||||||
|
I tested this with the upcoming 2.5.5 release of MaxScale with MariaDB 10.5.5 and it worked as expected when both MaxScale and MariaDB were running locally. Have you been able to test whether you see this problem with MariaDB? Does the problem only occur when the database has underscores in the name? In addition, if you can execute the authentication queries listed here for MaxScale 2.5 we can see what the actual data for the user is. It might be that Percona formats the user data in some other format which causes problems with the authentication in MaxScale. | ||||||||||
| Comment by Cuchac [ 2020-10-12 ] | ||||||||||
|
Hello, I can reproduce it in 2.5.4. It is caused by escaped wildcard character '_' in `mysql.db` table in `db` column. I guess `strip_db_esc=true` was developped just for this case but probably stopped working in 2.5. To reproduce, just create a grant for user to database
and it does not work. After removing backslash, it starts to work. But the backslash is required there. |