193 Commits

Author SHA1 Message Date
Johan Wikman
aa11c960b1 2.3.20 Update change date 2020-06-05 09:31:45 +03:00
Johan Wikman
f527a8f2e6 2.3.19 Update Change Date 2020-04-23 14:23:57 +03:00
Johan Wikman
e0cd6adb26 Update change date for 2.3.18 2020-03-10 10:45:47 +02:00
Markus Mäkelä
e180c20055
MXS-2899: Update charset only when successful
By updating the server charset only when we successfully query it, the
charset will not change due to network connectivity problems.
2020-02-27 14:18:51 +02:00
Johan Wikman
cfb3f79b54 Update 2.3.17 Change Date 2020-02-10 15:28:38 +02:00
Markus Mäkelä
a0affe1bb7
MXS-2784: Use SQL to fetch default character set
The Connector-C was changed to always return only the client's charset,
not the actual charset that the connection ends up using. To cope with
this, the code has to use SQL to join the default character set name to
the default collation for it which can be used to extract the numeric ID
of the charset.
2020-01-24 10:51:15 +02:00
Markus Mäkelä
e2976a6689
MXS-2843: Remove password hash from log_info output 2020-01-21 09:27:08 +02:00
Johan Wikman
790d90f229 Update 2.3.16 Change Date 2020-01-15 11:08:51 +02:00
Markus Mäkelä
aa83bc24ae
MXS-2820: Log default database on auth failure
The default database was not exposed in the warning that was logged when
authentication failed. The authentication uses the username, host and the
default database to find the user entry and the lack of the default
database made it hard to know for sure which user entry a client should've
matched against.
2020-01-02 12:00:10 +02:00
Markus Mäkelä
964207cbea
MXS-2820: Return correct value on wrong password 2020-01-02 11:34:47 +02:00
Markus Mäkelä
374d5b28d1
MXS-2759: Optimize user loading query
The SQL for the second recursive CTE table can be optimized by adding a
where condition on the recursive part that rules out users that are not
roles. The functionality remains the same as only roles can be granted to
users.
2019-11-29 16:16:34 +02:00
Johan Wikman
df6c56e7ca Update 2.3.13 Change Date 2019-10-29 12:51:31 +02:00
Johan Wikman
110bc32b25 MXS-2621 Fix broken authorization SQL 2019-08-02 09:48:14 +03:00
Markus Mäkelä
f8ee11cf55
MXS-2606: Sort servers before loading users
By sorting the servers in descending order based on their role we make
sure that the users are loaded from a master if one is available.
2019-07-17 14:42:32 +03:00
Markus Mäkelä
f139991a2c
MXS-2559: Log source of loaded users
MySQLAuth now logs the server where the users were loaded from. As only
the initial loading of users causes a log message, it is still possible
for the source server to change without any indication of it.
2019-07-17 10:23:48 +03:00
Marko
edbbafc2e9 MXS-2502 Fix access denied when connecting to 'information_schema' 2019-07-05 10:37:31 +03:00
Markus Mäkelä
1012b95544
Merge branch '2.2' into 2.3 2019-05-31 12:40:15 +03:00
Markus Mäkelä
114e095e1b
MXS-2525: Fix non-plugin authentication
Older clients assume the plugin used for authentication is
mysql_native_password. If the client doesn't request plugin
authentication, don't treat it as an error.
2019-05-29 12:41:53 +03:00
Markus Mäkelä
8317fec745
MXS-2496: Check for ALL PRIVILEGES grant
If a user has ALL PRIVILEGES as a global privilege, it overshadows the
SHOW DATABASES grant.
2019-05-22 09:56:35 +03:00
Markus Mäkelä
b294acf276
MXS-2496: Fix SHOW DATABASES grant check
The code expected that the grant was given to the actual user, not a role.
2019-05-21 13:43:51 +03:00
Markus Mäkelä
f94355770f
Merge branch '2.2' into 2.3 2019-05-17 14:10:28 +03:00
Markus Mäkelä
2cd4da32a7
MXS-2494: Fix user loading queries for MariaDB 10.1+
The queries now properly check for the plugin.
2019-05-16 10:41:04 +03:00
Esa Korhonen
fadbdc7514 Merge branch '2.2' into 2.3 2019-03-22 12:11:24 +02:00
Esa Korhonen
9236ace077 MXS-2355 If client is using the wrong authenticator, attempt a switch
Some SQL clients may default to a different authentication plugin than
"mysql_native_password". Since this is the only one supported by MySQL-
authenticator, the client is instructed to swap its plugin.
2019-03-21 17:07:09 +02:00
Markus Mäkelä
77ef3dd613
Merge branch '2.2' into 2.3 2019-03-05 04:54:40 +02:00
Markus Mäkelä
8a0b6005a4
MXS-2335: Fix lower_case_table_names
The database check always used the case-sensitive SQL to check that the
database exists.
2019-03-05 00:07:13 +02:00
Markus Mäkelä
26da72a41f
Merge branch '2.2' into 2.3 2019-01-03 09:23:16 +02:00
Markus Mäkelä
04dd05b262
MXS-2231: Move TLS handshake code into MariaDBClient
The code is now in the correct place and TLS connections with all
authenticators should now work.
2019-01-02 19:29:41 +02:00
Markus Mäkelä
edd03e950f
MXS-2209: Use compound roles only with 10.2.15+
Due to MDEV-15556 and MDEV-15840 recursive CTEs can't be reliably used
with older 10.2 versions. To prevent problems, only use the query that
extracts composite roles with newer versions.
2019-01-02 19:27:14 +02:00
Johan Wikman
cf66cc6968 Merge branch '2.2' into 2.3 2018-11-28 11:27:44 +02:00
Markus Mäkelä
24d1876ed4
Initialize memory in password hashing
The authentication code did not initialize one of the buffers used to
calculate the password hashes. This resulted in the use of uninitialized
memory when the user provided no password.
2018-11-28 00:15:57 +02:00
Esa Korhonen
01628dd0de Cleanup server version updating 2018-11-21 17:36:52 +02:00
Markus Mäkelä
e5d6e5329a
Format source code
Formatted all of the source code that was not accordance with the coding
style. This was caused by merges from 2.2 into 2.3.
2018-11-01 14:05:15 +02:00
Markus Mäkelä
ce35b0d541
Merge branch '2.2' into 2.3 2018-10-30 14:16:33 +02:00
Markus Mäkelä
eb10b723dd
MXS-2117: Fall back to old style query with 10.2.11
If a 10.2.11 or older server without a grant on all mysql tables is found,
the authenticator now falls back to the 10.1 behavior that uses subqueries
instead of CTEs. This is a more user friendly way of working around
MDEV-13453 that causes the problem as all functionality except the support
for composite roles is retained.
2018-10-30 12:45:36 +02:00
Markus Mäkelä
93b9ed744f
MXS-2111: Use authentication_string when password is empty
If the password field in mysql.user is empty, it is possible that the
actual password is stored in the authentication_string field. Most of the
time this happens due to MDEV-16774 which causes the password to be stored
in the authentication_string field.

Also added a test case that verifies the problem and that it is fixed by
this commit.
2018-10-30 12:45:36 +02:00
Markus Mäkelä
2594a0d913
Improve detection of problems caused by MDEV-13453
Instead of looking at the server version, the actual error message should
be inspected. This guarantees that the correct error message is logged
even with custom builds.
2018-10-30 12:45:36 +02:00
Markus Mäkelä
e5a0b4e9bb
Merge branch '2.2' into develop 2018-09-21 14:18:15 +03:00
Markus Mäkelä
60915f847f
MXS-2064: Log workaround for grant problems with MariaDB 10.2.10
When the 10.2 users query is executed with a MariaDB server older than
10.2.11, the query will fail due to inadequate grants on the 'users' table
generated as a part of the CTE. To work around the issue, a SELECT grant
on the whole mysql database is required. Logging the server where the
query fails also helps resolve the problem by pointing out where the grant
needs to be added.
2018-09-21 11:14:45 +03:00
Markus Mäkelä
71ffef5708
Partially revert 4ba011266843857bbd3201e5b925a47e88e1808f
Add back leading operator enforcement.
2018-09-20 15:57:30 +03:00
Markus Mäkelä
d8d0b1a29c
Merge branch '2.2' into develop 2018-09-20 12:21:53 +03:00
Markus Mäkelä
8c2f6aafcc
MXS-2060: Load users from only valid servers
Users should only be loaded from a server if it is running and not in
maintenance.
2018-09-19 20:32:39 +03:00
Markus Mäkelä
7ec2f77708
Merge branch '2.2' into develop 2018-09-12 23:18:08 +03:00
Esa Korhonen
fd176c4122 Merge branch '2.2' into develop 2018-09-11 12:57:19 +03:00
Markus Mäkelä
889877c0ab
MXS-1947: Add support for composite roles
Added support for composite roles for 10.2 and newer versions. As
recursive CTEs are required to extract the role mappings, composite roles
aren't supported on 10.1.
2018-09-10 21:47:47 +03:00
Markus Mäkelä
d11c78ad80
Format all sources with Uncrustify
Formatted all sources and manually tuned some files to make the code look
neater.
2018-09-10 13:22:49 +03:00
Niclas Antti
c447e5cf15 Uncrustify maxscale
See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
2018-09-09 22:26:19 +03:00
Markus Mäkelä
8b653133a7
Add shutdown detection
The maxscale_is_shutting_down function is used to detect when MaxScale
should stop. This fixes a race condition in the code where the workers has
not yet been initialized but a termination signal has been received. It
also replaces the misuse of the service_should_stop variable with a proper
function.
2018-08-29 11:06:11 +03:00
Johan Wikman
3f53eddbde MXS-2020 Replace ss[_info]_dassert with mxb_assert[_message] 2018-08-22 11:34:59 +03:00
Johan Wikman
b1e405442f MXS-2020 Replace ss_debug with MXB_AT_DEBUG 2018-08-22 11:34:06 +03:00