Commit Graph

7024 Commits

Author SHA1 Message Date
d61f0d0afd Remove useless debug assertion
The debug assertion assumes that the table definition is always in the
binlogs. If a binlog row event without a table definition is read, debug
versions would crash even though the situation is acceptable and expected.
2017-02-07 10:21:58 +02:00
906a42d9a8 Use dcb_foreach inside dcb.c
All DCB listing code should use dcb_foreach to list them.
2017-02-07 10:21:58 +02:00
b074e7e8c8 Fix user cache directory permissions
The user cache directory is only used by the maxscale user so only the
maxscale user should have access to it.
2017-02-07 10:03:58 +02:00
c6e1705f8d Add diagnostic entry point to authenticators
The authenticators should have a similar way to print diagnostic
information as filter and routers do. This allows the authenticators to
print the users in their own format.

In the future, all the diagnostic entry points should be changed so that
they return a structure that contains the information in a standard
form. This information can then be formatted in different ways by other
modules.
2017-02-07 10:03:58 +02:00
a909fd0208 Fix injection of service user
The parameters that were given to the user creation function were in the
wrong order.
2017-02-07 10:03:58 +02:00
62fdd68ac0 Make sure user cache directory exists
The cache directory needs to be created by the authenticator itself.
2017-02-07 10:03:58 +02:00
70061e6323 Return correct value for failed db authentication
The unknown database error was never triggered as all authentication
errors returned MXS_AUTH_FAILED.
2017-02-07 10:03:58 +02:00
11c3e6ac91 Don't users with a pre-4.1 password
The old error message and behavior was lost with the new implementation.
2017-02-07 10:03:58 +02:00
9a80e1cd5b Reorder SQL statements when persisting users
The statements are now executed in a more controlled order and a failure
of one will skip the others. The transaction is also rolled back if it
fails.
2017-02-07 10:03:58 +02:00
7ad7536b57 Fix enable_root_user
The option was inverted.
2017-02-07 10:03:58 +02:00
7dce744e0b Remove unused code from MySQLAuth
Removed the old implementation of MySQL authentication. The user printing
functionality still expects a hashtable which should be fixed.
2017-02-07 10:03:58 +02:00
4d5d988bf0 Exact hostnames grants take precedence over wildcard grants
MariaDB and others match grants first by exact hostname/IP and then by
wildcard. If there are no exact matches, the wildcard grant should be
picked. This can be tested by having different passwords for localhost and
remote address.

The SQLite based authentication should first check for an exact match and
then only after that should it try to match the hostname to a wildcard
grant.
2017-02-07 10:03:57 +02:00
2b59d5031e Fix memory leak in dbusers.c
The MySQL connection was created twice.
2017-02-07 10:03:57 +02:00
fe1a49f4e9 Use new authentication for reauthentication
This fixes the reauthentication of users that was missing from the new
implementation. Now COM_CHANGE_USER should work properly.
2017-02-07 10:03:57 +02:00
acdde499ed Replace get_users implementation with new version
The get_users function now combines the functionality of the old get_users
and get_all_users. This removes large parts of similar code.

Removed the listener resources as MySQLAuth was the only one that used it.
2017-02-07 10:03:57 +02:00
3d2fc2ccb2 Store SQLite tables on disk
The SQLite database users are cached on disk. This allows the binlogrouter
to authenticate users without a connection to the master server.
2017-02-07 10:03:57 +02:00
54d8eb9595 Store databases in the SQLite database
The databases are now also stored in the sqlite database. This allows the
`resource` member of the USERS struct to be removed in the future.
2017-02-07 10:03:57 +02:00
2b4ff82999 Use SQLite3 based authentication
The user data is now stored inside a SQLite3 database. By storing the data
inside a database, we remove the restriction that the previous hashtable
based implementation had.
2017-02-07 10:03:57 +02:00
ce5e429ad3 Move reauthentication to authenticators
Currently the only situation where a user needs to be authenticated after
the initial authentication is when a COM_CHANGE_USER is being
executed. This was previously handled by directly calling a function in
the MySQLAuth authenticator.

The new entry in the API of the authenticators is very specific to MySQL
and should be reviewed once other protocols are added.
2017-02-07 10:03:57 +02:00
2bceb1128d Update ChangeLog and Release Notes 2017-02-07 09:40:15 +02:00
e3bed424ea MXS-1123: Fix connection_timeout causing constant disconnections
In a configuration with multiple services, one with connection_timeout and
others without it, the connections to non-connection_timeout services
would get immediately closed due to integer overflow.
2017-02-06 23:03:57 +02:00
c0f5124f6f Fix field name parsing in avrorouter
The backtick was copied to the field name and converted to an underscore
when the name was transformed into a valid Avro identifier. This caused
one extra character to appear in the field name in the Avro schema files.
2017-02-06 16:35:40 +02:00
c849b57fff Merge branch 'develop' into MXS-109 2017-02-06 11:25:20 +01:00
7c5e326dd5 Remove listing of persisted DCBs
As the DCBs are "owned" by threads and are handled without locks, no
cross-thread access to those DCBs should be done. Due to this, the show
persistent command for maxadmin has to be changed to show only the size of
the pool.
2017-02-06 10:29:10 +02:00
869e6ac950 Remove useless maxadmin commands
The commands did nothing.
2017-02-06 10:29:10 +02:00
9f88ee3eec Errors must not be cached
For instance, if bob is returned an error because he does not have
the required grants, then if the error were cached, alice would
receive bob's error reply even if she has the required grants.
2017-02-06 09:41:37 +02:00
a5a579ffce Rename BUILD_AVRO to BUILD_CDC
Using the broader CDC name instead of AVRO for the CMake variable name
makes more sense as there are modules other than the avrorouter.
2017-02-03 14:39:56 +02:00
2bb62a28cb MXS-109: added comments and minor improvements
Some minor improvements and freeing of info.cluster_uuid after
hashtable_add
2017-02-03 12:43:32 +01:00
d8e05436b1 Update Cache documentation 2017-02-03 12:43:44 +02:00
6ee257dc5f Only log an error if the binlog file exists
The avrorouter logged an error every time it tried to open a file even if
the file doesn't exist.
2017-02-03 08:16:12 +02:00
f3cb0830e6 MXS-109: membership based on cluster_size
Monitored nodes could be part of different cluster UUIDs: select only
the ones belonging to UUID with more joined nodes.

In case of different UUIDs if the joined numbers is less than (n_nodes
/ 2 ) + 1 don’t consider any node part of the cluster
2017-02-02 14:53:36 +01:00
4ccfc35b00 Fix regression of MXS-1111
The function that was added to detect the commands that should always be
allowed wasn't used.
2017-02-02 13:50:44 +02:00
13997fc5b9 Fix prepared statements being rejected by dbfwfilter
The merge with 2.0 caused the dbfwfilter to reject all prepared statements
when they are supported in 2.1.
2017-02-02 13:34:57 +02:00
a2ffb0476f Fix insertstream value implicit insert detection
The pointer being at the end of the buffer was not checked.
2017-02-02 12:58:30 +02:00
3a447607a7 Move inserstream into the core
The filter is a part of 2.1 so it should be in the core.

Added a note into the documentation about the experimental status.
2017-02-01 21:08:25 +02:00
eeb3cc436e Remove wildcard domain name matching
This was buggy with the current user database implementation. Need
to think of some other way to implement this feature.
2017-02-01 19:30:42 +02:00
6db1cc25af Documentation cleanup for Limitations.md
Headers are now more consistent. Reordered headers. Changed wording.
2017-02-01 19:27:51 +02:00
eb5e284a90 Rephrase the schemarouter limitations
The text was not very clear as to whether the prepared statements were
actually supported.
2017-02-01 17:52:00 +02:00
3d02343a40 Update date in release notes 2017-02-01 15:07:53 +02:00
ea0b4d6b45 @file comment now consistently above includes 2017-02-01 13:07:13 +02:00
6b6fd83f26 Remove revision comments 2017-02-01 11:50:38 +02:00
4ef4cb490b Cache: Use consistent naming
- snake_case
- member variables prefixed with m_
- static member variables prefixed with s_
- where prefixes are used (z,p,s), the following character
  is capitalized
2017-02-01 10:43:41 +02:00
f2da434b56 Fix merge problem with dbfwfilter
Code was duplicated in the merge and the old function names were used.
2017-02-01 09:58:38 +02:00
712b720ef7 Use correct define names
The old name for MXS_STRERROR_BUFLEN was used in avrorouter.
2017-02-01 09:55:32 +02:00
e64a641bcd Merge branch '2.0' into develop 2017-02-01 09:35:13 +02:00
2b950e60fd Monitor connect error is now logged
Monitor connect error is now logged
2017-01-31 15:42:05 +01:00
a8780b8924 Add PS limitation of schemarouter to limitations
As prepared satements aren't parsed by the schemarouter, it can't support
prepared statements.
2017-01-31 13:48:51 +02:00
00f16e1fa5 Make parameters for command_is_mandatory const
The parameters can be const as they aren't modified.
2017-01-31 10:16:33 +02:00
82105d20e1 Fix a typo in readwritesplit documentation
Fixed a typo in readwritesplit documentation. The cluster should be in
plural form.
2017-01-31 10:10:25 +02:00
49bb63810e Cache: Add limitation 2017-01-31 08:30:11 +02:00