154 Commits

Author SHA1 Message Date
Markus Makela
2a35312022 Cleaned up the usage of the connector library
The monitor permission checks didn't use the standard connection timeouts but
used hard-coded values. The config.c tried to connect to the embedded library
but since it is not used by it anymore, it always fails.
2016-03-02 21:27:34 +02:00
Markus Makela
6da0446df0 Made function parameters constant and added debug checks
The number of written characters is now checked and should be lower than
compared bytes. The parameters to the dbusers.c query functions are now const
where possible.
2016-02-16 11:16:41 +02:00
Markus Makela
c4bcc4ce88 Table-level access to databases is now detected
Previously the users needed at least SELECT permission on the database level to
be able to connect with a default database through MaxScale. With this change,
the query that retrieves the database users has been changed to also include
table-level grants for users. This will allow users with grants to only some of
the tables in a database to be able to connect through MaxScale with a default
database.
2016-02-16 11:16:41 +02:00
Markus Makela
e468132b8b Cleaned up user data queries
The queries are now created at runtime to allow for a more varied syntax. This
removes the need to have separate query strings for the standard mysql.user
table and for the MySQL 5.7 version of it. In addition to this, the exclusion
of the root user is now done at the same time which removes the need to manually
form the query string.
2016-02-16 11:16:41 +02:00
Johan Wikman
fc6f49fe8a Link against Connector-C.
Now, qc_mysqlembedded is linked against MySQL's embedded library,
and MaxScale itself against Connector-C.

So, in order to build MaxScale, Connector-C must be installed.
This has been tested with Connector-C 2.2.1.

The build variable MYSQLCLIENT_LIBRARIES is no longer used.
2016-02-01 15:43:05 +02:00
Johan Wikman
475dfb7288 Use common function for setting up MySQL connection.
Earlier the same (or almost the same) code was duplicated in
several places.

A conflicting declaration was also removed. There was no
implementation for that declaration.
2016-01-29 16:30:48 +02:00
Johan Wikman
d054f5d7bd Cleanup of dbusers.[h|c]
- All functions used only in c-file declared as static.
- All module functions declared.
- A few camelClase names changed to underscore.
2016-01-29 10:54:41 +02:00
Markus Makela
872d02db3e Finalized configuration processing cleanup
All parts of the configuration processing are now in their own functions.
This allows new objects to be created after MaxScale has started.
2016-01-20 09:25:03 +02:00
Markus Makela
78b5777d6e Fixes to Coverity defects
Few fixes to possible use of freed memory and resource leaks.
2015-12-15 13:13:53 +02:00
Markus Makela
73e2d9950c Changed tabs to spaces in dbusers.c
Some tabs were missed when formatting dbuser.c
2015-11-30 12:31:47 +02:00
Markus Makela
275580d6a8 Formatted dbusers.c according to the style guide
Fixed indentation, missing/misaligned brackets and made sure line length is
kept as close to 80 characters as possible.
2015-11-30 11:50:37 +02:00
Johan Wikman
44df53d846 LOGIF and skygw_write_log removed from server/core/*.c
LOGIF and skygw_write_log removed from server/core/*.c and
replaced with calls to MXS_(ERROR|WARNING|NOTICE|INFO|DEBUG).
This is a mechanism change, no updating of the actual message
has been performed.

Currently this causes a very small performance hit, since the
check whether the priority is enabled or not is performed in
the function that is called and not before the function is called.
Once all LOGIFs and skygw_write_logs have been replaced, the
behaviour will be altered back to what it was.
2015-11-16 09:49:12 +02:00
Markus Makela
6b88b6b17f Merge branch 'develop' into MXS-329-develop-20151111 2015-11-13 07:48:59 +02:00
Markus Makela
5efd564573 Fix to MXS-288: https://mariadb.atlassian.net/browse/MXS-288 Added MySQL 5.7 authentication
The change to the mysql.user table in MySQL 5.7 caused MaxScale to stop
working with it. This commit adds functionality that checks which version of
the user data query should be made. It also moves common code related to
server version strings to server.c
2015-11-12 15:24:27 +02:00
counterpoint
dee20fe077 Merge remote-tracking branch 'origin/develop' into MXS-329-develop-20151111
# Conflicts:
#	server/core/CMakeLists.txt
#	server/core/buffer.c
#	server/core/service.c
#	server/modules/filter/tee.c
#	server/modules/monitor/mysql_mon.c
#	server/modules/routing/binlog/blr.c
#	server/modules/routing/binlog/blr_slave.c
#	server/modules/routing/debugcmd.c
#	server/modules/routing/readwritesplit/readwritesplit.c
#	utils/skygw_utils.cc

- resolved.
2015-11-11 11:08:02 +00:00
Johan Wikman
834a88aeda Log variables moved to log_manager.h
The log manager variables lm_enabled_log_files_bitmask, log_ses_count
and tls_log_info that earlier were declared separately in every
c-file are now declared in the log_manager.h header.
2015-11-04 14:26:53 +02:00
Markus Makela
d57b4cd531 Fix to MXS-54: https://mariadb.atlassian.net/browse/MXS-54
Added a new configuration parameter that allows the user to control
whether authentication warning messages are logged.
2015-11-04 09:18:20 +02:00
Markus Makela
9cd327a783 Fix to MXS-417: https://mariadb.atlassian.net/browse/MXS-417 Added support for single-character wildcard in IP addresses.
Single character wildcard addresses are now properly handled
2015-11-03 10:15:34 +02:00
MassimilianoPinto
1dc48f5ed8 Merge branch 'develop' into 1.2.1-binlog_router_trx 2015-10-23 13:18:11 +02:00
Markus Makela
04a1f9bd3d Error messages in getDatabases are now unique. 2015-10-20 22:45:29 +03:00
Markus Makela
2dfb9e3c11 Merge branch 'develop' into MXS-329 2015-09-24 17:59:36 +03:00
MassimilianoPinto
653bb57e7f Merge branch 'develop' into 1.2.1-binlog_router_trx 2015-09-23 18:44:13 +02:00
Markus Makela
618a641b96 Reformatted user authentication queries as multi-line strings instead of one long string. 2015-09-23 08:00:58 +03:00
counterpoint
7aa36b77ea Guarantee router session is present for call to clientReply; properly free callbacks; attempt to set all necessary values for dbusers; do more to ensure buffers freed. 2015-09-21 14:25:12 +01:00
MassimilianoPinto
4e3ef93fe5 Merge branch 'develop' into 1.2.1-binlog_router_trx 2015-09-18 15:28:08 +02:00
MassimilianoPinto
67c9f30632 Added missing NULL byte for resource
Added missing NULL byte for resource
2015-09-18 15:27:36 +02:00
MassimilianoPinto
11c4a1a491 Merge branch 'develop' into 1.2.1-binlog_router_trx 2015-09-16 19:09:08 +02:00
Markus Makela
fe400e7041 Fixed service permission checks failing without SELECT privilege on mysql.db for the servuce user. 2015-09-16 11:10:24 +03:00
MassimilianoPinto
c2c27d7cca Merge from develop
Merge from develop
2015-09-14 09:49:33 +02:00
Markus Makela
c11c4733a4 Fixed wrong error message in dbusers 2015-09-12 05:43:32 +03:00
MassimilianoPinto
6fe8082445 Merge branch 'develop' into 1.2.1-binlog_router_trx 2015-09-09 10:20:25 +02:00
Markus Makela
5350a85e2b Fix to MXS-356: https://mariadb.atlassian.net/browse/MXS-356
Added configurable timeouts for the embedded MySQL connections.
2015-09-08 11:23:35 +03:00
MassimilianoPinto
4653830104 Develop merge
Develop merge
2015-09-07 11:13:49 +02:00
Johan Wikman
160bbb70ee MXS-251: strerror
Replaces all calls to strerror with calls to strerror_r. The former
is non-thread safe while the latter is.
2015-09-05 15:52:13 +03:00
MassimilianoPinto
55248ec60e Merge branch 'develop' into 1.2.1-binlog_router_trx 2015-08-28 16:42:15 +02:00
Markus Makela
45227c8875 Changed service permission checks to fail when user doesn't have access rights. 2015-08-28 17:39:45 +03:00
Markus Makela
00a3d7eb56 Made service permission checks less strict. 2015-08-28 17:33:05 +03:00
MassimilianoPinto
a591b47b9f Merge branch 'develop' into 1.2.1-binlog_router_trx 2015-08-28 16:09:32 +02:00
Markus Makela
3a901bfea7 Added automatic configuration of localhost_match_wildcard_host. 2015-08-28 14:55:40 +03:00
Markus Makela
c5214bea1b Cleaned up code and changed function structure. 2015-08-28 12:54:38 +03:00
Markus Makela
296bdc5df6 Fixed errors and added comments. 2015-08-28 12:54:38 +03:00
Markus Makela
525daf827a Service are not started if user permissions are inadequate.
Also cleaned up code and error messages.
2015-08-28 12:54:38 +03:00
Markus Makela
cb2b465510 Changed queries to more closely match actual queries. 2015-08-28 12:54:38 +03:00
Markus Makela
4da9045da4 Removed redundant function. 2015-08-28 12:54:38 +03:00
Markus Makela
94eb1b4eb1 Added service and monitor permission checks. 2015-08-28 12:51:37 +03:00
root
61c47375d5 Merge branch 'develop' into 1.2.1-binlog_router
Conflicts:
	server/core/server.c
	server/include/server.h
	server/modules/include/blr.h
	server/modules/routing/binlog/blr.c
	server/modules/routing/binlog/blr_file.c
	server/modules/routing/binlog/blr_master.c
	server/modules/routing/binlog/blr_slave.c
2015-08-04 07:59:44 -04:00
MassimilianoPinto
9480c01b96 New log messages for dbusers loading failure
New log messages for dbusers loading failure
2015-07-13 18:12:34 +02:00
Markus Makela
584ad321ff Fixed possible crash. 2015-07-13 13:22:19 +03:00
Markus Makela
4706b756c2 Changed the service resource hashing function into a proper string hashing function. 2015-06-30 19:16:49 +03:00
Markus Makela
88940c0097 Fixed wildcard grants not being added to the users table. 2015-06-27 09:47:06 +03:00