1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-14 13:41:20 +03:00
Commit Graph

2967 Commits

Author SHA1 Message Date
79078167c3 MDEV-17753 ALTER USER fail to replicate
Change mysql_alter_user to log alter user command.
2019-01-13 20:59:45 +05:30
83c81d8991 MDEV-7598 Lock user after too many password errors 2019-01-08 17:18:47 +01:00
734510a44d Merge 10.3 into 10.4 2019-01-06 17:43:02 +02:00
6bb11efa4a Merge branch '10.2' into 10.3 2019-01-03 13:09:41 +01:00
b7a9563b21 Merge 10.1 into 10.2 2018-12-21 09:43:35 +02:00
8ede9b3ae5 MDEV-17975 Assertion ! is_set()' or !is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed upon REVOKE under LOCK TABLE
open_grant_tables() returns -1/0/1, where -1 is an error, while 1 is not.
Don't store it's return value in bool
2018-12-20 08:39:54 +01:00
19d3d3e861 MDEV-16266 - New command FLUSH SSL to reload server's SSL certificate(private key,CRL,etc) 2018-12-12 22:51:20 +01:00
4abb8216a0 MDEV-17658 change the structure of mysql.user table
Implement User_table_json.
Fix scripts to use mysql.global_priv.
Fix tests.
2018-12-12 00:31:44 +01:00
a76aadf7bc MDEV-17658 change the structure of mysql.user table
Introduce User_table_tabular(mysql.user) and User_table_json(mysql.global_priv).
The latter is not implemented.
Automatic fallback to the old implementation works.

Results change because privilege tables are opened in a different
order now.
2018-12-12 00:31:04 +01:00
9887d2e881 cleanup: simplify opening of priv tables
prepare TABLE_LIST in a loop and just before opening
don't store TABLE_LIST inside Grant_table_base.
2018-12-12 00:31:04 +01:00
a701426b43 cleanup: refactor grant table classes in sql_acl.cc
move all backward compatibility related code into User_table,
the caller should not know or care anymore.

Other tables (Db_table, etc) are *not* refactored.

For consistency with other updates, setting a default role
no longer errors out when the mysql.user table is too old.
2018-12-12 00:31:04 +01:00
3df7287d21 fix the test for the empty password hash string
because the first byte of a _binary hash_ can be 0x00 too.

This fixes main.connect test on centos73-ppc64
2018-12-12 00:31:04 +01:00
8049160936 MDEV-17946 : Unsorted acl_dbs after RENAME USER 2018-12-10 17:23:03 +01:00
fac997feef Fix Win64 build 2018-12-08 02:19:37 +01:00
b1c41e112c MDEV-17932 : assertion in multi RENAME USER command.
Sort acl_users inside the mysql_rename_user()'s loop, after every
successful iteration.

This is needed because on the next loop's iteration find_user_exact()
is used, which requires correct sorting by name.
2018-12-08 01:17:39 +01:00
a80f5fdbd1 Merge 10.3 into 10.4 2018-12-08 00:29:21 +02:00
2fd0acd30f Fix the 64-bit Windows build 2018-12-08 00:06:07 +02:00
ce8716a1ed Merge 10.3 into 10.4 2018-12-07 16:29:37 +02:00
21069c528e Merge 10.2 into 10.3 2018-12-07 15:39:34 +02:00
5e5deabdbc Merge 10.1 into 10.2 2018-12-07 13:41:10 +02:00
6491c591b2 Merge branch '10.0' into 10.1 2018-12-06 15:08:42 +01:00
daca7e70d7 MDEV-17898 FLUSH PRIVILEGES crashes server with segfault
merge_role_db_privileges() was remembering pointers into Dynamic_array
acl_dbs, and later was using them, while pushing more elements into the
array. But pushing can cause realloc, and it can invalidate all pointers.

Fix: remember and use indexes of elements, not pointers.
2018-12-06 14:22:07 +01:00
8a37ce0767 cleanup: DYNAMIC_ARRAY -> Dynamic_array<ACL_DB> acl_dbs 2018-12-06 14:22:07 +01:00
f77895ebf3 MDEV-15649 Speedup search in acl_users and acl_dbs array,
sorting them by usernames first, and then by get_sort() value.


Search functions now use binary search to find the the first entry with
given name. Then, linear search is done, until the first match.
2018-12-06 09:52:31 +01:00
074c684099 Merge 10.3 into 10.4 2018-11-06 16:24:16 +02:00
df563e0c03 Merge 10.2 into 10.3
main.derived_cond_pushdown: Move all 10.3 tests to the end,
trim trailing white space, and add an "End of 10.3 tests" marker.
Add --sorted_result to tests where the ordering is not deterministic.

main.win_percentile: Add --sorted_result to tests where the
ordering is no longer deterministic.
2018-11-06 09:40:39 +02:00
32062cc61c Merge 10.1 into 10.2 2018-11-06 08:41:48 +02:00
dd6e74c62a MDEV-16774 SET PASSWORD and ALTER USER with slightly different results
set both `password` and `authentication_string` columns in `mysql`.`user`
table for now.

Suppress the "password was ignored" warning if the password is
the same as the authentication string
2018-11-01 15:48:15 +01:00
7c40996cc8 MDEV-12321 authentication plugin: SET PASSWORD support
Support SET PASSWORD for authentication plugins.

Authentication plugin API is extended with two optional methods:
* hash_password() is used to compute a password hash (or digest)
  from the plain-text password. This digest will be stored in mysql.user
  table
* preprocess_hash() is used to convert this digest into some memory
  representation that can be later used to authenticate a user.
  Build-in plugins convert the hash from hexadecimal or base64 to binary,
  to avoid doing it on every authentication attempt.

Note a change in behavior: when loading privileges (on startup or on
FLUSH PRIVILEGES) an account with an unknown plugin was loaded with a
warning (e.g. "Plugin 'foo' is not loaded"). But such an account could
not be used for authentication until the plugin is installed. Now an
account like that will not be loaded at all (with a warning, still).
Indeed, without plugin's preprocess_hash() method the server cannot know
how to load an account. Thus, if a new authentication plugin is
installed run-time, one might need FLUSH PRIVILEGES to activate all
existing accounts that were using this new plugin.
2018-10-31 16:06:16 +01:00
14e181a434 misc cleanups
* remove dead code (from .yy)
* remove redundant commands from the test
* extract common code into a reusable function
  (get_auth_plugin, push_new_user)
* rename update_user_table->update_user_table_password
* simplify acl_update_user
* don't strdup a string that's already in a memroot
  (in ACL_ROLE::ACL_ROLE(ACL_USER*))
* create parent_grantee and role_grants dynamic arrays with size 0.
  to avoid any memory allocations when roles aren't used.
2018-10-31 16:06:16 +01:00
76151f3cbc Use mysql.user.authentication_string for password
Don't distinguish between a "password hash" and "authentication string"
anymore. Now both are stored in mysql.user.authentication_string, both
are handled identically internally. A "password hash" is just how some
particular plugins interpret authentication string.

Set mysql.user.plugin even if there is no password. The server will use
mysql_native_password plugin in these cases, let's make it expicit.

Remove LEX_USER::pwhash.
2018-10-31 16:06:16 +01:00
1cc03e1f19 cleanup: sql_acl.cc remove fix_plugin_ptr()
it was doing two my_strcasecmp() unconditionally, to optimize away one
conditional my_strcasecmp() later.
2018-10-31 16:06:16 +01:00
dd78430548 cleanup: sql_acl.cc remove username=NULL
Some parts of sql_acl.cc historically assumed that empty username
is represented by username=NULL, other parts used username="" for that.
And most of the code wasn't sure and checked both
(like in `if (!user || !user[0])`).

Change it to use an empty string everywhere.
2018-10-31 16:06:16 +01:00
3476854013 cleanup: sql_acl.cc password->LEX_CSTRING 2018-10-31 16:06:16 +01:00
ca7401afdf cleanup: safe_lexcstrdup_root() 2018-10-31 16:06:16 +01:00
329058be29 wsrep: create a macro for the error: label
that is used by WSREP_TO_ISOLATION_BEGIN and other galera macros,
to avoid the need for wrapping this label in #ifdef WITH_WSREP/#endif
2018-10-24 14:48:08 +02:00
43ee6915fa Merge 10.2 into 10.3 2018-10-09 09:11:30 +03:00
8c2360dee8 MDEV-17373 Windows: application verifier stop "Attempt to use an unknown SOCKET" 2018-10-05 16:48:51 +01:00
57e0da50bb Merge branch '10.2' into 10.3 2018-09-28 16:37:06 +02:00
5ae8fce50b Merge branch '10.1' into 10.2 2018-09-24 11:46:08 +02:00
1fc5a6f30c Merge branch '10.0' into 10.1 2018-09-23 12:58:11 +02:00
80bcb05b24 Merge remote-tracking branch 'origin/5.5' into 10.0 2018-09-21 08:37:42 +04:00
14ddcb1ff2 Bug#27407480: AUTOMATIC_SP_PRIVILEGES REQUIRES NEED THE INSERT PRIVILEGES FOR MYSQL.USER TABLE
A test case and a followup fix
2018-09-04 08:31:46 +02:00
0aa9b03393 Merge branch '10.2' into 10.3 2018-08-12 12:02:23 +02:00
affdd79c69 Merge branch '10.1' into 10.2 2018-08-03 23:26:26 +02:00
05459706f2 Merge 10.2 into 10.3 2018-08-03 15:57:23 +03:00
701f0b8e36 Fix gcc 7.3 compiler warnings. 2018-08-03 14:37:55 +02:00
ef3070e997 Merge 10.1 into 10.2 2018-08-02 08:19:57 +03:00
865e807125 Merge branch '10.0' into 10.1 2018-07-31 11:58:29 +02:00
91181b225c Merge 5.5 into 10.0 2018-07-30 15:09:25 +03:00