2014-03-13 16:35:14 +01:00
|
|
|
--source include/have_unix_socket.inc
|
|
|
|
|
|
|
|
#
|
|
|
|
# MDEV-3909 remote user enumeration
|
|
|
|
# unix_socket tests
|
|
|
|
#
|
2021-06-09 13:17:58 +02:00
|
|
|
create table global_priv_backup select * from mysql.global_priv;
|
|
|
|
update mysql.global_priv set priv=json_insert(priv, '$.plugin', 'unix_socket');
|
|
|
|
delete from mysql.global_priv where user != 'root';
|
2014-03-13 16:35:14 +01:00
|
|
|
flush privileges;
|
|
|
|
|
2018-10-17 12:48:13 +02:00
|
|
|
# Make sure that the replace works, even if $USER is 'user' or something else
|
|
|
|
# that matches other parts of the error message.
|
|
|
|
let $replace=Access denied for user '$USER';
|
|
|
|
|
2014-11-12 11:10:13 +01:00
|
|
|
--echo connect(localhost,USER,,test,MASTER_PORT,MASTER_SOCKET);
|
2018-10-17 12:48:13 +02:00
|
|
|
--replace_result $replace "Access denied for user 'USER'"
|
2014-11-12 11:10:13 +01:00
|
|
|
--disable_query_log
|
2014-03-16 19:21:37 +01:00
|
|
|
--error ER_ACCESS_DENIED_NO_PASSWORD_ERROR
|
2014-03-13 16:35:14 +01:00
|
|
|
connect (fail,localhost,$USER);
|
2014-11-12 11:10:13 +01:00
|
|
|
--enable_query_log
|
2014-03-13 16:35:14 +01:00
|
|
|
|
2019-02-19 01:04:56 +01:00
|
|
|
--replace_result $replace "Access denied for user 'USER'"
|
2014-03-16 19:21:37 +01:00
|
|
|
--error ER_ACCESS_DENIED_NO_PASSWORD_ERROR
|
2014-03-13 16:35:14 +01:00
|
|
|
change_user $USER;
|
|
|
|
|
2021-06-09 13:17:58 +02:00
|
|
|
replace mysql.global_priv select * from global_priv_backup;
|
2014-03-13 16:35:14 +01:00
|
|
|
flush privileges;
|
2021-06-09 13:17:58 +02:00
|
|
|
drop table global_priv_backup;
|