Commit Graph

715 Commits

Author SHA1 Message Date
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
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
e64a641bcd Merge branch '2.0' into develop 2017-02-01 09:35:13 +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
fdee329198 MXS-1111: Allow COM_PING and other commands to pass the firewall
The firewall filter should allow COM_PING and other similar commands to
pass through as they are mainly used to check the status of the backend
server or to display statistics. The COM_PROCESS_KILL is the exception as
it affects the state of the backend server. This is better controlled with
permissions in the server than in the firewall filter.

Commands that require special grants aren't allowed to pass as they are
mainly for maintenance purposes and these should not be done through the
firewall.
2017-01-30 19:16:33 +02:00
03067b586c Cache: Install storage implementations as well
As the cache is marked as being core, the storage modules needs
to be marked as core as well.
2017-01-30 14:23:54 +02:00
4adc9d705b Build Jansson if library not found
If the Jansson JSON library is not found on the system, it is built from
source.
2017-01-27 12:19:27 +02:00
8b83bf834e Clean up router.h
Nothing moved to core, just rename and cleanup.
2017-01-26 16:14:17 +02:00
aa8851fbe1 Remove listmanager
The file wasn't used, so any traces of listmanager.h or .c have been
erased.
2017-01-25 16:11:12 +02:00
7d51864402 Clean config.h some more
Moved some typedefs to router.h and server.h, changed a few
constants to these enums. Renamed some types in config.h to
remove "Gateway".

There are still some functions in the public header which are
only used in core, but they seem to fit the theme of public functions
so were not moved.
2017-01-25 16:05:51 +02:00
126d9be749 Remove noisy logging 2017-01-23 15:31:01 +02:00
47d21bd519 Masking: Change "rules_file" parameter to "rules"
The firewall filter and the cache have similar rules files and
they use "rules". To be consistent, the masking filter should
use "rules" as well.
2017-01-23 15:17:23 +02:00
ead0d4fe3e No point storing version info in transient storage
As the RocksDB storage is re-created at each startup it does not
make sense to store version information in it.
2017-01-23 15:09:13 +02:00
6a90b0c629 Ok to continue even if storage directory is created at startup
Due to some refactoring that possibility had been lost.
2017-01-23 15:08:57 +02:00
eb05132a5c Cache: Use MXS_MODULE_PARAM_SIZE 2017-01-23 11:01:57 +02:00
50f594fa4e Fix ccrfilter parameters
The filter used the value of `count` for the `time` parameter.

The `options` parameter used the old-style parsing of the options and the
`match` and `exclude` parameters didn't use config_copy_string.
2017-01-22 09:24:00 +02:00
03402a86ed Check that ccrfilter time is enabled before using it
The filter calculated a time difference which was negative if the filter
was not configured to use time intervals.

Added more info level logging to help determine how the filter behaves.
2017-01-22 09:24:00 +02:00
4e6fde8a23 Use query type instead of operation for ccrfilter
The query operation not being a select is too strict and not very
precise. Only queries that actually modify data should trigger the adding
of routing hints.
2017-01-22 09:24:00 +02:00
7824c98dcc Maxrows filter is now the core 2017-01-20 15:46:03 +01:00
b4d7739bdc namedserverfilter.c: removed unused var
Removed unused var in namedserverfilter.c
2017-01-20 14:40:29 +01:00
872bbd1ab3 Make cache part of the core 2017-01-20 13:30:00 +02:00
be1bdfaa92 Mark masking as part of the core 2017-01-20 13:30:00 +02:00
57b530a2e8 MXS-1065: add wildcards support to source option in namedfilter
It’s possible to add % wildcards in the ‘source’ option of
namedserverfilter.
Allowed values, for an IP address only are:

X.%.%.%
X.Y.%.%
X.Y.Z.%

The match any ‘%’ is not allowed
2017-01-20 12:15:20 +01:00
6e38276a20 Rename files, removing "gw"-prefix
Also gwdirs.h.in -> paths.h.in
2017-01-20 12:55:52 +02:00
ffc68a688f Fix mqfilter build failure
It called an internal session function for no real reason.
2017-01-20 09:09:56 +02:00
c9a61fec6d Masking: Use common constants
- Response related constants moved from ComPacket to ComResponse
- Constants defined using defines from .../maxscale/protocol/mysql.h
2017-01-19 14:52:13 +02:00
6499994af8 Cache: Use existing defines 2017-01-19 14:52:13 +02:00
1077b313a4 Cache: Handle large packets
Basically the only thing that needs to be done is not to mistake
a 8 byte length encoded integer as an EOF packet.
2017-01-19 14:52:13 +02:00
8aa76727d2 Remove explicit long indicator of size defines 2017-01-19 10:42:05 +02:00
31c8481f6c Fix cache parameter default value 2017-01-19 09:26:37 +02:00
8c236c1cdc Define ComEOF packet length in terms of MYSQL_EOF_PACKET_LEN 2017-01-19 09:26:37 +02:00
fed61fde98 Disable prepared statement execution in dbfwfilter
The dbfwfilter doesn't parse prepared statements for all rules which
requires that they are disabled.
2017-01-19 08:57:15 +02:00
cfcd1dc38f Maxrows filter uses new constants: MYSQL_EOF_PACKET_LEN and MYSQL_OK_PACKET_MIN_LEN
New constants MYSQL_EOF_PACKET_LEN, MYSQL_OK_PACKET_MIN_LEN are now
used by max rows filter
2017-01-18 15:47:04 +01:00
e4d6af37a9 Masking: Distinguish between EOF and 8 byte integer
When processing the response to a COM_QUERY, the rows will be
terminated by an EOF packet. However, as the type byte of an
EOF packet is 0xFE and the identifying byte of an 8 byte length
encoded integer is also 0xFE it is not possible to distinguish
the two except by also looking at packet length.
2017-01-18 14:31:48 +02:00
fbb63f4eb8 Masking: Handle larger than 16MB payloads
Larger than 16MB payloads can either be ignored or then they may
cause the session to be aborted.
2017-01-18 08:45:51 +02:00
969e423eb2 Masking: Add large_payload parameter
The masking filter will assume payloads less than 2^24 - 1. The
behaviour if payloads larger than than are encountered can be
configured.

The actual implementation follows in a subsequent change.
2017-01-18 08:44:04 +02:00
16a76fcd28 Rename qc_get_type() to qc_get_type_mask()
To make it plain that it is a mask that is returned and not a
specific value from the enum qc_query_type_t.
2017-01-18 08:34:53 +02:00
86c97a2109 Analyze binary prepared statements as well
Now that the query classifier can be given COM_STMT_PREPARE packets
in addition to COM_QUERY packets, binary prepared statements will
be subject to the same analyses as any other statement.
2017-01-18 08:34:53 +02:00
f7892843b5 Handle prepared named statements in firewall filter
Binary prepared statements need to be addressed separately.
2017-01-18 08:34:53 +02:00
5fc7b277da Change SESSION to MXS_SESSION
Some modules didn't use the new MXS_SESSION structure.
2017-01-18 08:31:47 +02:00
fb771c8a2e Rename public types and constants in session.h
Preparing to split session.h into module and core sections.
2017-01-17 16:30:14 +02:00
f9440a6b35 Parse only valid packets in dbfwfilter
The filter attempted to parse all packets that were routed through the
filter.
2017-01-17 14:48:43 +02:00
c25b7629f4 Format filter modules
Formatted filter modules with Astyle.
2017-01-17 14:47:50 +02:00
5b92a1f467 Remove explicit module name from log messages
The module name doesn't need to be logged as MXS_MODULE_NAME will be
automatically added as a prefix to all messages logged by the module.
2017-01-17 12:51:08 +02:00
2cabcea211 Add definitions of MXS_MODULE_NAME to all modules
All modules now declare a name for the module. This is name is added as a
prefix to all messages logged by a module. The prefix should help
determine which part of the system logs a message.
2017-01-16 11:28:34 +02:00
74c55e5c82 Remove qc_is_real_query use from mqfilter
The use of this function is not necessary as it is only done as an
optimization.
2017-01-16 10:56:33 +02:00
08b5d5c957 Detect redefined rules
If a rule is defined more than once, an error is logged and the parsing
fails.
2017-01-16 10:56:33 +02:00