189 Commits

Author SHA1 Message Date
Markus Makela
de2910f75b Fixed SSL_accept failing if the GWBUF with the initial MySQL auth packet contains some of the SSL authentication data. 2015-06-09 22:27:15 +03:00
Markus Makela
196d41cb88 More debug output. 2015-06-09 20:02:45 +03:00
Markus Makela
06c5da7b17 Minor fix to SSL authentication. 2015-06-09 02:56:55 +03:00
Markus Makela
1c36cfb285 Added more debug output. 2015-06-08 18:04:43 +03:00
Markus Makela
61ea0861ff Fixed some connections hanging with SSL. 2015-06-08 14:35:31 +03:00
Markus Makela
e83799648a Fixed queries getting stuck when the SSL records were of the maximum allowed size. 2015-06-05 11:00:51 +03:00
Markus Makela
08e0a31826 Fixed session creation failure messages using the wrong packet number when an SSL connection was made. 2015-06-02 06:42:41 +03:00
Markus Makela
6e01757455 Added error message to users when trying to connect to a MaxScale service that only allows SSL connections. 2015-06-02 06:39:51 +03:00
Markus Makela
d7232d8b6e Moved SSL structure to the DCB instead of the MySQL protocol.
This allows for non-MySQL SSL connections.
2015-06-01 20:51:26 +03:00
Markus Makela
4d5291c263 Fixed wrong packet sequence number causing a disconnect from the client. 2015-06-01 13:58:26 +03:00
Markus Makela
a2768955e7 SSL handshake now successfully completes when a client connects with SSL enabled. 2015-06-01 13:50:22 +03:00
Markus Makela
0f814d3e73 Added SSL write and read functions. 2015-05-29 13:00:37 +03:00
Markus Makela
f946a44620 Added handling of partial SSL handshakes. 2015-05-28 23:11:32 +03:00
Markus Makela
a572166ffd Added ssl handshake to mysql_client 2015-05-28 22:19:50 +03:00
Markus Makela
449c186a66 Added OpenSSL init function call. 2015-05-28 18:14:00 +03:00
Markus Makela
3d6259cb00 Added configuration options for different SSL modes. 2015-05-28 16:33:51 +03:00
Markus Makela
16d6bd6d2c Added service SSL mode variables. 2015-05-28 11:56:14 +03:00
Markus Makela
1b3af7d61f Fixes to Coverity defects. 2015-04-16 19:41:49 +03:00
Markus Makela
3a0807251c Fix to MXS-54: https://mariadb.atlassian.net/browse/MXS-54
Added log messages for failed authentication attempts.
2015-03-30 15:43:51 +03:00
Markus Makela
7c794b1d21 Fixed a memory leak in mysql_client 2015-03-27 20:28:04 +02:00
Markus Makela
9e7afeb302 Merge branch 'develop' into MAX-324
Conflicts:
	macros.cmake
	server/core/config.c
	server/core/service.c
	server/modules/routing/CMakeLists.txt
2015-02-24 06:26:55 +02:00
Markus Makela
aa4932bf2d Moved the housekeeper heartbeat to a separate header for ease of integration.
This keeps the behavior the same but allows the heartbeat to be used as a crude timer
without including everything the housekeeper.h header includes.

Moved the protocol level updates on the DCBs last_read value into dcb_read.
This keeps the implementation nice and compact.
2015-02-24 05:00:16 +02:00
Markus Makela
c47d2f3791 Added session timeouts.
The parameter 'connection_timeout' for services takes a value as seconds.
All sessions that have been idle for longer than this will be disconnected.
2015-02-20 22:16:43 +02:00
Markus Makela
83b7948cdf Added more debug output to user authentication. 2015-02-20 14:50:26 +02:00
MassimilianoPinto
5ba2bf33e9 Fix Coverity defect 87079
Fix Coverity defect 87079
2015-02-07 11:02:39 +01:00
MassimilianoPinto
625a7d7a10 Assertion removed
Assertion removed
2015-02-04 18:31:38 +01:00
MassimilianoPinto
0cf1a35511 Removed useless assertion
Removed useless assertion
2015-02-04 17:19:07 +01:00
MassimilianoPinto
4ef3677b84 Fix for Bug #519
Fix for Bug #519
2015-02-04 16:17:36 +01:00
Mark Riddoch
0083e62c41 Merge branch 'blr' into develop 2015-02-03 17:19:06 +00:00
VilhoRaatikka
270c0ebf8a Clean up, added comments, removed some dead code. 2015-01-27 10:24:37 +02:00
VilhoRaatikka
6d2b38d4b6 Complementary fix to #694,http://bugs.mariadb.com/show_bug.cgi?id=694
RWSplit router handles query processing errors that happened in router by sending parse error reply to client. routeQuery fails only when backend has failed.
2015-01-17 22:40:52 +02:00
VilhoRaatikka
da77da803b Complementory fix to bug #694, http://bugs.mariadb.com/show_bug.cgi?id=694
Added new error action to router.h, added functionality to reset error flag from DCB in handleError. Error is reset before every new routing call.
2015-01-16 11:13:42 +02:00
VilhoRaatikka
39e4253c81 Fix to bug #694, http://bugs.mariadb.com/show_bug.cgi?id=694
query_classifier.cc: set_query_type lost previous query type if the new was more restrictive. Problem was that if query is both READ and SESSION_WRITE and configuration parameter use_sql_variables_in=all was set, routing target became ambiguous. Replaced call to set_query_type with simply adding new type to type (=bit field) and checking unsupported combinations in readwritesplit.c:get_route_target. If such a case is met, a detailed error is written to error log in readwritesplit.c. mysql_client.c sees the error code and sends an error to client. Then mysql_client.c calls router's handleError which ensures that there are enough backend servers so that the session can continue.
2015-01-15 15:16:22 +02:00
Mark Riddoch
613ed8bb61 Cleanup some log messages 2015-01-07 17:37:32 +00:00
VilhoRaatikka
6228be4284 Fix to bug #678, http://bugs.skysql.com/show_bug.cgi?id=678
tee.c:routeQuery cloned partial MySQL packets to be routed to child router. Problems were due to the use of gwbuf_clone and modutil_MySQL_query which clone/examine only the first buffer from the buffer list which composes GWBUF.
modutil.c: Added function modutil_MySQL_query_len which calculates MySQL packet length and the missing bytecount
2015-01-02 18:32:57 +02:00
VilhoRaatikka
51ebfb9862 Fix to Coverity issue 85210. 2014-12-31 16:29:07 +02:00
VilhoRaatikka
77bd279a01 Fix to prevent double free of dcb->data/session->data. If authentication fails, call free(dcb->data) only when DCB in question is *not* cloned. 2014-12-30 12:28:36 +02:00
VilhoRaatikka
df0b04a5c0 Fix: accessed released memory in mysql_client.c where dcb->data was released in gw_mysql_do_authentication and accessed afterwards. 2014-12-30 10:36:06 +02:00
VilhoRaatikka
635fcf708f Fix to bugs #665, and #664. Potentially to #649.
http://bugs.skysql.com/show_bug.cgi?id=665
http://bugs.skysql.com/show_bug.cgi?id=664
http://bugs.skysql.com/show_bug.cgi?id=649

dcb.c:dcb_final_free: (665):set dcb->session->client pointer to NULL so that it won't be read anymore and other threads won't try to close it.
	dcb_final_free:(664):don't free dcb->data, it is either freed in session_alloc if session creation fails or in session_free only.
session.c:if session creation fails, free dcb->data and remove links between client DCB and session.
mysql_backend.c:(665):gw_backend_close:check that session->client isn't NULL and that client DCB's state is still polling before calling dcb_close for it.
mysql_client.c:gw_mysql_do_authentication:if anything fails, and session_alloc won't be called, free dcb->data.
mysql_common.c:gw_send_authentication_to_backend:if session is already closing then return with error.
2014-12-29 20:19:01 +02:00
VilhoRaatikka
ff5fe23ce6 dcb.b:dcb_final_free:replaced ((dcb->flags & DCBF_CLONE)==0) with macro !DCB_IS_CLONE(dcb)
readwritesplit.h:Removed invalid macros which assumed that ROUTER_CLIENT_SES->rses_backend_ref always pointed to valid and used backend reference and thus included potential risk of NULL-pointer refernce.
mysql_backend.c and mysql_client.c:avoid executing CHK_PROTOCOL(p) after original DCB has been released the memory.
readwritesplit.c:Replaced RSES_CLEINT_DCB macro with a function which returns client DCB for a given router client session.
2014-12-23 16:10:27 +02:00
VilhoRaatikka
f0d8ed0cf2 Fix to #657, http://bugs.mariadb.com/show_bug.cgi?id=657
session.c:session_free:if session is child of another service (tee in this case), it is the parent which releases child's allocated memory back to the system. This now also includes the child router session.
dcb.h: Added DCB_IS_CLONE macro
tee.c:freeSession:if parent session triggered closing of tee, then child session may not be closed yet. In that case free the child session first and only then free child router session and release child session's memory back to system.
tee.c:routeQuery: only route if child session is ready for routing. Log if session is not ready for routing and set tee session inactive
mysql_client.c:gw_client_close:if DCB is cloned one don't close the protocol because they it is shared with the original DCB.
2014-12-23 00:26:57 +02:00
MassimilianoPinto
19cf44bd59 Coverity fixes: 72650, 72665
Coverity fixes: 72650, 72665
2014-12-09 08:58:52 +01:00
VilhoRaatikka
6a54d888de Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA 2014-12-08 16:04:27 +02:00
VilhoRaatikka
5264a1abc9 Added function documentation, moved one non-error log entry to message log, cleaned up a bit. 2014-12-08 16:02:16 +02:00
Mark Riddoch
ce056dccd8 Update modue status of all GA modules 2014-12-08 09:19:35 +00:00
VilhoRaatikka
fd11e6a7f5 Session-specific logging. Added functions
void session_enable_log(SESSION* ses, logfile_id_t id)
and
void session_disable_log(SESSION* ses, logfile_id_t id)

Which switch specific log type on/off if the log type in question is not generally enabled.

Each thread carries a thread-specific struct log_info_t which includes members for current session id and bitfield for enabled log types for the current session. That information is checked before actual log write functions are called.

Each file where session-specific logging is used, must include the following exports:

/** Defined in log_manager.cc */
extern int            lm_enabled_logfiles_bitmask;
extern size_t         log_ses_count[];
extern __thread log_info_t tls_log_info;
2014-11-19 00:08:59 +02:00
VilhoRaatikka
70eef7aaa8 Fix to bug #513, http://bugs.skysql.com/show_bug.cgi?id=513 2014-11-17 15:33:13 +02:00
VilhoRaatikka
8c1e7172f3 Added debug logging for #615 2014-11-14 20:48:33 +02:00
MassimilianoPinto
d090eee09b Messages moved from stderr to MESSAGE log
Messages moved from stderr to MESSAGE log
2014-11-14 10:19:04 +01:00
VilhoRaatikka
9edee192a8 Merge branch 'develop' of https://github.com/mariadb-corporation/MaxScale into develop 2014-11-13 18:00:43 +02:00