Commit Graph

280 Commits

Author SHA1 Message Date
d96a7dedc5 MXS-2205 Convert maxscale/poll.h to .hh 2018-12-04 14:51:02 +02:00
43c33e9f4a MXS-2196: Allocate a session before allocating DCBs
Allocating the session before a DCB guarantees that at no point will a DCB
have a null session. This further clarifies the concept of the session and
also allows the listener reference to be moved there.

Ideally, the session itself would allocate and assign the client DCB but
since the Listener is the only one who does it, it's acceptable for now.
2018-12-04 11:50:43 +02:00
8046a314e5 MXS-2196: Move DCB initialization into DCB constructor
More of the DCB initialization is now done in the DCB constructor. This
makes the creation of new DCBs simpler but it can be even simpler. By
passing the file descriptor that the DCB should use into the constructor
almost all of the initialization would be done inside it.

Also removed the unused path member variable.
2018-12-04 11:50:43 +02:00
45827dd433 MXS-2196: Store listener reference in DCB
By storing the reference in the DCB, the two-way dependency between the
listeners and services is severed. Now the services have no direct link to
listeners and after the destruction of a listener it will be freed once
all connections through it have closed.

Due to the fact that a listener itself has a DCB that must point to a
valid listener, a self-reference is stored in the listener DCB. This is
extremely confusing and is only here to keep the code functional until the
DCB part of the listener can be factored out.
2018-12-04 11:50:43 +02:00
ad12ff6d06 MXS-2196: Rename dcb.h to dcb.hh 2018-12-04 11:50:43 +02:00
a10b6c2e89 MXS-2196: Take Listener into use 2018-12-04 11:39:52 +02:00
39f668ff3c MXS-2196: Rename SERV_LISTENER to Listener 2018-12-04 11:39:52 +02:00
d9ae298102 MXS-2205 Combine maxscale/server.h with maxscale/server.hh
The server-struct is still used in several .h-files.
2018-12-03 16:47:27 +02:00
756593a718 MXS-2205 Combine maxscale/router.h with maxscale/router.hh 2018-12-03 15:28:06 +02:00
72d8ab5220 MXS-2205 Convert modules/include/cdc.h to .hh 2018-12-03 15:28:06 +02:00
97bb7e7e1a MXS-2205 Combine maxscale/modutil.h with maxscale/modutil.hh 2018-12-03 15:28:06 +02:00
35cdbc7220 MXS-2205 Convert modulecmd.h to .hh 2018-12-03 14:06:02 +02:00
3e5818fcb6 MXS-2205 Convert mysql_utils.h to .hh 2018-12-03 14:05:21 +02:00
0f755adc78 MySQLAuth header to .hh 2018-12-03 11:00:29 +02:00
01e9f71af1 MXS-2197: Make SERV_LISTENER a C++ class
The class is still mostly the same as the old C version but it now uses
std::string instead of char pointers. Changed configuration default values
so that the parameters passed to the listener allocation are always valid.
2018-11-30 12:15:57 +02:00
77585bdb8c MXS-2197: Make config.h and service.h C++ headers
This is the first step into converting the other headers into C++.
2018-11-30 12:15:57 +02:00
dbe9e0c471 MXS-2163 Some minor refactoring
- Name constants and functions consistently.
- Factor out common functionality.
- Address review comments.
2018-11-28 15:27:23 +02:00
a4d073ec56 MXS-2163 If clustrix do not "use mysql" 2018-11-28 15:27:23 +02:00
31fdf37555 MXS-2163 Add Clustrix users query 2018-11-28 15:27:23 +02:00
194e751fb2 MXS-2163 Add function for checking Clustrix table permissions 2018-11-28 15:27:23 +02:00
79db52c30e MXS-2163 Factor out table permission check
In the case of Clustrix the check must target different tables,
so a separate function will then be provided for that.
2018-11-28 15:27:23 +02:00
cf66cc6968 Merge branch '2.2' into 2.3 2018-11-28 11:27:44 +02:00
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
01628dd0de Cleanup server version updating 2018-11-21 17:36:52 +02:00
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
ce35b0d541 Merge branch '2.2' into 2.3 2018-10-30 14:16:33 +02:00
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
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
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
75ea1b6ea1 Fix formatting of new(std::nothrow)
The code previously formatted everything as `new( std::nothrow)`.
2018-10-04 21:50:44 +03:00
75f9921ca2 Merge branch '2.2' into develop 2018-10-02 10:18:09 +03:00
f65c890287 MXS-2049: Forward client credentials to backend server
Instead of requesting another set of credentials, the client credentials
are simply forwarded to the backend MariaDB server.
2018-10-02 09:44:01 +03:00
9278da1f54 MXS-2067: Remove spinlock.h
Removed the spinlock.h header and replaced with plain pthread types and
functions.
2018-09-28 12:18:24 +03:00
e5a0b4e9bb Merge branch '2.2' into develop 2018-09-21 14:18:15 +03:00
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
71ffef5708 Partially revert 4ba011266843857bbd3201e5b925a47e88e1808f
Add back leading operator enforcement.
2018-09-20 15:57:30 +03:00
d8d0b1a29c Merge branch '2.2' into develop 2018-09-20 12:21:53 +03:00
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
7ec2f77708 Merge branch '2.2' into develop 2018-09-12 23:18:08 +03:00
fd176c4122 Merge branch '2.2' into develop 2018-09-11 12:57:19 +03:00
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
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
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
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
3f53eddbde MXS-2020 Replace ss[_info]_dassert with mxb_assert[_message] 2018-08-22 11:34:59 +03:00
b1e405442f MXS-2020 Replace ss_debug with MXB_AT_DEBUG 2018-08-22 11:34:06 +03:00
24ab3c099c Move top of the file "#pragma once" to after the following comment (swap them). If the comment is a BPL update it to the latest one 2018-08-21 13:13:15 +03:00
d428292ec0 Add workaround to building tests without all dependencies
The system tests can be build even if not all of the dependencies for
MaxScale are met.
2018-08-20 13:56:58 +03:00
cf0aeed516 MXS-2014 Rename log_manager.h to log.h
There's nothing resembling a manager anymore.
2018-08-17 10:59:37 +03:00
ae43e4f0f2 MXS-2013 Remove all CHK_-macros 2018-08-15 09:28:04 +03:00