[MXS-3572] Maxscale 2.5 not handle single quotes via mysql client throw incorrect "Access denied error" Created: 2021-05-25  Updated: 2021-12-15  Resolved: 2021-07-12

Status: Closed
Project: MariaDB MaxScale
Component/s: N/A
Affects Version/s: 2.5.10, 2.5
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Richard Stracke Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: need_feedback

Issue Links:
Relates
relates to MXS-3292 Unable to execute use `database` Closed

 Description   

Connecting via mysql client, where the arguments will be wrapped into backticks leads to not valid
"Access not ednied "error.

To reproduce:

Use docker-.compose setup

https://github.com/mariadb-corporation/maxscale-docker

Change maxscale version in docker-compose.yml from 2.4 to 2.5

With backticks... it throws an error

~/mt2/maxscale-docker/maxscale$ mysql -u maxuser -h'127.0.0.1' -p'maxpwd' -P4006 -D'test'
ERROR 1045 (28000): Access denied for user 'maxuser'@'::ffff:192.168.112.1' (using password: YES)

Without backticks, it works without issue.

~/mt2/maxscale-docker/maxscale$ mysql -u maxuser -h127.0.0.1 -pmaxpwd -P4006 -Dtest
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 10.3.5-MariaDB-10.3.5+maria~jessie-log mariadb.org binary distribution

Note:

It works with 22.4 without issue also with backticks.



 Comments   
Comment by markus makela [ 2021-05-25 ]

Can you verify that this happens outside of docker? This seems like shell escaping problems.

Comment by Richard Stracke [ 2021-06-10 ]

markus makela

Yes, reproduced it with vagrant, mariadb 10.5.10 and maxscale 2.5.13

[root@centos etc]# mysql -u maxscale -h'127.0.0.1' -p'maxscale_pw' -P4006 -D'test'
ERROR 1045 (28000): Access denied for user 'maxscale'@'::ffff:127.0.0.1' (using password: YES)
[root@centos etc]# mysql -u maxscale -h'127.0.0.1' -p'maxscale_pw'  -D'test'
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 44
Server version: 10.5.10-MariaDB MariaDB Server
 
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Comment by markus makela [ 2021-06-18 ]

I still cannot reproduce this:

mysql -u bob -p'bob' -h 127.0.0.1 -P 4006 -D t1 -e "show grants;show databases;"
+----------------------------------------------------------------------------------------------------+
| Grants for bob@%                                                                                   |
+----------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `bob`@`%` IDENTIFIED BY PASSWORD '*61584B76F6ECE8FB9A328E7CF198094B2FAC55C7' |
| GRANT ALL PRIVILEGES ON `t1`.* TO `bob`@`%`                                                        |
+----------------------------------------------------------------------------------------------------+
+--------------------+
| Database           |
+--------------------+
| information_schema |
| t1                 |
| test               |
+--------------------+

Tested with the upcoming MaxScale 2.5.14 and MariaDB 10.5.10.

Please provide exact steps to verify this.

Generated at Thu Feb 08 04:22:23 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.