mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-21928 ALTER USER doesn't remove excess authentication plugins from mysql.global_priv
only use auth1 update (no "auth_or":[]) array, if there was no "auth_or" array in the json yet.
This commit is contained in:
@ -193,3 +193,16 @@ user() current_user() database()
|
|||||||
mysqltest1@localhost mysqltest1@% test
|
mysqltest1@localhost mysqltest1@% test
|
||||||
drop user mysqltest1;
|
drop user mysqltest1;
|
||||||
uninstall soname 'auth_ed25519';
|
uninstall soname 'auth_ed25519';
|
||||||
|
create user mysqltest1 identified via mysql_native_password as password("good") OR unix_socket;
|
||||||
|
show create user mysqltest1;
|
||||||
|
CREATE USER for mysqltest1@%
|
||||||
|
CREATE USER `mysqltest1`@`%` IDENTIFIED VIA mysql_native_password USING '*8409037B3E362D6DAE24C8E667F4D3B66716144E' OR unix_socket
|
||||||
|
alter user mysqltest1 identified via mysql_native_password as password("better");
|
||||||
|
show create user mysqltest1;
|
||||||
|
CREATE USER for mysqltest1@%
|
||||||
|
CREATE USER `mysqltest1`@`%` IDENTIFIED BY PASSWORD '*6E6CABC9967AB586F009616BA69DAC2953849C88'
|
||||||
|
flush privileges;
|
||||||
|
show create user mysqltest1;
|
||||||
|
CREATE USER for mysqltest1@%
|
||||||
|
CREATE USER `mysqltest1`@`%` IDENTIFIED BY PASSWORD '*6E6CABC9967AB586F009616BA69DAC2953849C88'
|
||||||
|
drop user mysqltest1;
|
||||||
|
@ -194,3 +194,14 @@ drop user mysqltest1;
|
|||||||
|
|
||||||
uninstall soname 'auth_ed25519';
|
uninstall soname 'auth_ed25519';
|
||||||
--remove_file $MYSQLTEST_VARDIR/tmp/peercred_test.txt
|
--remove_file $MYSQLTEST_VARDIR/tmp/peercred_test.txt
|
||||||
|
|
||||||
|
#
|
||||||
|
# MDEV-21928 ALTER USER doesn't remove excess authentication plugins from mysql.global_priv
|
||||||
|
#
|
||||||
|
create user mysqltest1 identified via mysql_native_password as password("good") OR unix_socket;
|
||||||
|
show create user mysqltest1;
|
||||||
|
alter user mysqltest1 identified via mysql_native_password as password("better");
|
||||||
|
show create user mysqltest1;
|
||||||
|
flush privileges;
|
||||||
|
show create user mysqltest1;
|
||||||
|
drop user mysqltest1;
|
||||||
|
@ -1425,9 +1425,12 @@ class User_table_json: public User_table
|
|||||||
|
|
||||||
bool set_auth(const ACL_USER &u) const
|
bool set_auth(const ACL_USER &u) const
|
||||||
{
|
{
|
||||||
StringBuffer<JSON_SIZE> json(m_table->field[2]->charset());
|
size_t array_len;
|
||||||
if (u.nauth == 1)
|
const char *array;
|
||||||
|
if (u.nauth == 1 && get_value("auth_or", JSV_ARRAY, &array, &array_len))
|
||||||
return set_auth1(u, 0);
|
return set_auth1(u, 0);
|
||||||
|
|
||||||
|
StringBuffer<JSON_SIZE> json(m_table->field[2]->charset());
|
||||||
bool top_done = false;
|
bool top_done = false;
|
||||||
json.append('[');
|
json.append('[');
|
||||||
for (uint i=0; i < u.nauth; i++)
|
for (uint i=0; i < u.nauth; i++)
|
||||||
|
Reference in New Issue
Block a user