Commit graph

1503 commits

Author SHA1 Message Date
Marko Mäkelä
742e1c727f Merge 10.6 into 10.7 2022-07-27 18:26:21 +03:00
Marko Mäkelä
30914389fe Merge 10.5 into 10.6 2022-07-27 17:52:37 +03:00
Marko Mäkelä
098c0f2634 Merge 10.4 into 10.5 2022-07-27 17:17:24 +03:00
Oleksandr Byelkin
15a2ff1231 MDEV-26647 (simple_password_check) Include password validation plugin information in the error message if the SQL statement is not satisfied password policy
Make the plugin reporting cause of the error.
2022-07-27 16:04:20 +02:00
Oleksandr Byelkin
3bb36e9495 Merge branch '10.3' into 10.4 2022-07-27 11:02:57 +02:00
Sergei Golubchik
0ee5cf837e disks plugin: check for build prerequisites properly 2022-07-26 14:42:32 +02:00
Marko Mäkelä
b9eb63618e Merge 10.5 into 10.6 2022-07-26 11:37:36 +03:00
Alexander Barkov
88b22356e6 MDEV-23287 The INET4 data type 2022-07-08 16:53:24 +04:00
Oleksandr Byelkin
a5f78505d7 MDEV-28838 password_reuse_check plugin mixes username and password
To prevent the problem of mixing user name and password and
host name and user name we add length of the hostname and user name
to the hash.
2022-07-06 12:23:31 +02:00
Sergei Golubchik
0fca5068a8 MDEV-28234 Change maturity of plugins for July 2022 Releases
mysql_json: GAMMA -> STABLE
2022-07-05 19:07:36 +02:00
Alexander Barkov
c12192b1c6 MDEV-27015 Assertion `!is_null()' failed in FixedBinTypeBundle<FbtImpl>::Fbt FixedBinTypeBundle<FbtImpl>::Field_fbt::to_fbt()
The assuption that Field::is_null() is always false when
Field_fbt::val_native() or Field_fbt::to_fbt() are called
was wrong.

In some cases, e.g. when this helper Field method is called:

  inline String *val_str(String *str, const uchar *new_ptr)

we temporarily reset Field::ptr to some alternative record buffer
but don't reset null_ptr, so null_ptr still points to null flags
of the original record. In such cases it's meaningless to test
the original Field::null_ptr when Field::ptr is temporarily reset:
they don't relate to each other.

Removing the DBUG_ASSERT.
2022-07-05 12:11:14 +04:00
Marko Mäkelä
404d4820af Merge 10.8 into 10.9 2022-06-28 10:59:01 +03:00
Marko Mäkelä
9523986299 Merge 10.7 into 10.8 2022-06-28 10:06:00 +03:00
Marko Mäkelä
ac0af4ec4a Merge 10.6 into 10.7 2022-06-28 08:34:12 +03:00
Alexander Barkov
4a7e337e5f MDEV-28963 Incompatible data type assignment through SP vars is not consistent with columns 2022-06-27 19:52:48 +04:00
Alexander Barkov
0bed4d72c0 MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
Now INSERT, UPDATE, ALTER statements involving incompatible data type pairs, e.g.:

    UPDATE TABLE t1 SET col_inet6=col_int;
    INSERT INTO t1 (col_inet6) SELECT col_in FROM t2;
    ALTER TABLE t1 MODIFY col_inet6 INT;

consistently return an error at the statement preparation time:

    ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'

and abort the statement before starting interating rows.

This error is the same with what is raised for queries like:
    SELECT col_inet6 FROM t1 UNION SELECT col_int FROM t2;
    SELECT COALESCE(col_inet6, col_int) FROM t1;

Before this change the error was caught only during the execution time,
when a Field_xxx::store_xxx() was called for the very firts row.
The behavior was not consistent between various statements and could do different things:
- abort the statement
- set a column to the data type default value (e.g. '::' for INET6)
- set a column to NULL

A typical old error was:

    ERROR 22007: Incorrect inet6 value: '1' for column `test`.`t1`.`a` at row 1

EXCEPTION:

Note, there is an exception: a multi-row INSERT..VALUES, e.g.:
    INSERT INTO t1 (col_a,col_b) VALUES (a1,b1),(a2,b2);
checks assignment compability at the preparation time for the very first row only:
    (col_a,col_b) vs (a1,b1)

Other rows are still checked at the execution time and return the old warnings
or errors in case of a failure. This is done because catching all rows at the
preparation time would change behavior significantly. So it still works
according to the STRICT_XXX_TABLES sql_mode flags and the table transaction ability.

This is too late to change this behavior in 10.7.
There is no a firm decision yet if a multi-row INSERT..VALUES
behavior will change in later versions.
2022-06-27 12:49:40 +04:00
Marko Mäkelä
87bd79b1e7 Merge 10.5 into 10.6 2022-06-27 10:59:31 +03:00
Marko Mäkelä
ea847cbeaf Merge 10.4 into 10.5 2022-06-27 10:51:20 +03:00
Vladislav Vaintroub
01c0345d44 MDEV-28819 Statically compiled encryption plugins do not work in mariadb-backup
Disable static build for encryption plugin file_key_management
2022-06-20 16:42:41 +02:00
Vladislav Vaintroub
3aabda7e18 MDEV-28819 Statically compiled encryption plugins do not work
Disable building hashicorp encryption plugin statically
2022-06-20 16:37:49 +02:00
Brad Smith
a9fe646797 Fix building the Hashicorp plugin on OpenBSD / NetBSD and DragonFlyBSD 2022-06-18 07:52:58 +03:00
Marko Mäkelä
5a33a37682 Merge 10.8 into 10.9 2022-06-07 09:20:07 +03:00
Marko Mäkelä
31fc2eb4bc Merge 10.7 into 10.8 2022-06-07 09:07:48 +03:00
Marko Mäkelä
09dc322342 Merge 10.6 into 10.7 2022-06-07 08:44:20 +03:00
Monty
814c69ea30 Merge remote-tracking branch 'origin/10.5' into 10.6 2022-06-06 17:41:46 +03:00
Marko Mäkelä
57d4a242da Merge 10.7 into 10.8 2022-06-06 16:22:09 +03:00
Alexander Barkov
6d99fdce18 MDEV-28491 Uuid. "UPDATE/DELETE" not working "WHERE id IN (SELECT id FROM ..)"
This is a 10.5 version of the patch.
2022-06-03 23:14:25 +04:00
Alexander Barkov
477776bfed MDEV-28491 Uuid. "UPDATE/DELETE" not working "WHERE id IN (SELECT id FROM ..)"
This is a 10.7 version of the patch.
2022-06-03 20:14:41 +04:00
Michal Schorm
6ec17142dc Fix the FSF address to match the current one in: http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt 2022-05-27 15:55:49 +10:00
Sergei Golubchik
bf2bdd1a1a Merge branch '10.8' into 10.9 2022-05-19 14:07:55 +02:00
Sergei Golubchik
443c2a715d Merge branch '10.7' into 10.8 2022-05-11 12:21:36 +02:00
Sergei Golubchik
fd132be117 Merge branch '10.6' into 10.7 2022-05-11 11:25:33 +02:00
Sergei Golubchik
3bc98a4ec4 Merge branch '10.5' into 10.6 2022-05-10 14:01:23 +02:00
Julius Goryavsky
404984980f MDEV-28500: Hashicorp: Debian packaging is broken
This commit fixes a documentation installation
issue (for debian packaging) and generally brings
the installation control files up to date (as for
the rest of the components).
2022-05-10 08:22:21 +02:00
Sergei Golubchik
ef781162ff Merge branch '10.4' into 10.5 2022-05-09 22:04:06 +02:00
Julius Goryavsky
2e14f2c889 MDEV-28279: Hashicorp: Cannot migrate hexadecimal keys from file key management
This commit fixes a bug in the algorithm for converting hexadecimal
strings to binary key values, which leads to incompatibility with other
plugins and reduces the effective information capacity of the keys.
The new key conversion algorithm is incompatible with tables which
alrady encrypted using a old plugin (plugin version less than or
equalt to the 1.05).
2022-05-09 07:55:41 +02:00
Julius Goryavsky
94841ba656 Hashicorp plugin: typo fixed 2022-05-09 07:55:41 +02:00
Julius Goryavsky
8ae5408cab MDEV-28442: Hashicorp: refactoring to wrap static variables into a class
This commit contains changes to refactor the the Hashicorp plugin code
which hides all variables previously declared as "static" and which are
not user-visible parameters into a special class that contains all the
plugin's dynamic data. This was done primarily to significantly simplify
the code of the initialization and deinitialization functions, which
previously contained a large number of gotos and complex branching
conditions to control memory deallocation.
2022-05-09 07:55:41 +02:00
Julius Goryavsky
e571174e80 MDEV-28291: Hashicorp: Cache variables claim to be dynamic but changes are ignored
This commit fixes an issue with no visible update in caching
option values after changing them dynamically while the server
is running. This issue was related to forgotten copy operations
of new values into dynamic variables. At the same time, internal
variables (responsible for caching) were always updated correctly.
The commit includes a test that checks that the update is now
reflected in the values of dynamic variables.
2022-05-09 07:55:41 +02:00
Julius Goryavsky
0902cfaec8 MDEV-28330: Hashicorp: Key caching doesn't appear to be working
Added test files for mtr that test failed configuration with
--loose-hashicorp-key-management-cache-version-timeout=180000
correctly set.
2022-05-09 07:55:41 +02:00
Julius Goryavsky
3d1f765066 MDEV-28276: Hashicorp: checking that kv storage is created with version 2+
For the plugin to work properly, we need support for key versioning,
and for this, the kv storage in Hashicorp Vault must be created with
version 2 or higher. This commit adds such a check performed during
plugin initialization.

Note: checking for kv storage version during plugin initialization
can be disabled via --hashicorp-key-management-check-kv-version=off
command-line option or via the corresponding option in the server
configuration files.
2022-05-09 07:55:41 +02:00
Julius Goryavsky
1c22a9d8ae MDEV-28277: Checking for mandatory "/v1/" prefix in the URL
According to the Hashicorp Vault API specifications,
the URL to access the keys must include the "/v1/" prefix
at the beginning of the path. This commit adds this parameter
check, as well as a check for the presence of at least one
letter in the hostname inside the URL and in the secret
store name (after "/v1/").
2022-05-09 07:55:41 +02:00
Julius Goryavsky
35989d9cc1 MDEV-28281: Hashicorp: Key ID is not indicated in the log record
This commit adds an indication of the ID of the not found key
(and, when appropriate, also an indication of the version number
of the key) in the log file, making it easier to find errors.
2022-05-09 07:55:41 +02:00
Julius Goryavsky
0c5d8b8730 MDEV-28275: Hashicorp: ASAN heap-use-after-free in get_version()
Passing a string as a parameter by value has been replaced by
passing by reference to avoid using memory after it has been freed.
2022-05-09 07:55:41 +02:00
Julius Goryavsky
1146b713b2 MDEV-19281: Plugin implementation for the Hashicorp Vault KMS
- Authentication is done using the Hashicorp Vault's token
  authentication method;
- If additional client authentication is required, then the
  path to the CA authentication bundle file may be passed
  as a plugin parameter;
- The creation of the keys and their management is carried
  out using the Hashicorp Vault KMS and their tools;
- Key values stored as hexadecimal strings;
- Key values caching is supported.
- Implemented a time-invalidated cache for key values and
  for key version numbers received from the Hashicorp Valult
  server;
- The plugin uses libcurl (https) as an interface to
  the HashiCorp Vault server;
- JSON parsing is performed through the JSON service
  (through the include/mysql/service_json.h);
- HashiCorp Vault 1.2.4 was used for development and testing.
2022-05-09 07:55:41 +02:00
Sergei Golubchik
a70a1cf3f4 Merge branch '10.3' into 10.4 2022-05-08 23:03:08 +02:00
Alexey Botchkov
7215b00354 MDEV-28431 auth_pam tool left zombie processes.
The faulure in username packet reading can lead to the
auth_plugin_tool zombie. So check and close the application.
2022-04-28 15:40:08 +04:00
Alexey Botchkov
add5137d84 MDEV-28429 audit plugin report OOOOO.
Few initializations to the connection_info structure added.
I think they can be removed if we are sure the bug was fixed.
2022-04-28 11:28:49 +04:00
Sergei Golubchik
e6bbc83d5e MDEV-26212 PAM authentication fails with ENOMEM
use posix_spawn(), not fork() - it's better for systems that don't
overcommit memory
2022-04-26 11:21:04 +02:00
Marko Mäkelä
6cb6ba8b7b Merge 10.8 into 10.9 2022-04-06 13:33:33 +03:00