mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
6382339144
This commit introduces a reset of password errors counter on any alter user command for the altered user. This is done so as to not require a complete privilege system reload.
60 lines
3 KiB
Text
60 lines
3 KiB
Text
set @old_max_password_errors=@@max_password_errors;
|
|
set global max_password_errors=2;
|
|
create user u identified by 'good_pass';
|
|
connect(localhost,u,bas_pass,test,MASTER_PORT,MASTER_SOCKET);
|
|
connect con1, localhost, u, bas_pass;
|
|
ERROR 28000: Access denied for user 'u'@'localhost' (using password: YES)
|
|
connect(localhost,u,bad_pass,test,MASTER_PORT,MASTER_SOCKET);
|
|
connect con1, localhost, u, bad_pass;
|
|
ERROR 28000: Access denied for user 'u'@'localhost' (using password: YES)
|
|
connect(localhost,u,good_pass,test,MASTER_PORT,MASTER_SOCKET);
|
|
connect con1, localhost, u, good_pass;
|
|
ERROR HY000: User is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'
|
|
connect(localhost,u,bad_pass,test,MASTER_PORT,MASTER_SOCKET);
|
|
connect con1, localhost, u, bad_pass;
|
|
ERROR HY000: User is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'
|
|
FLUSH PRIVILEGES;
|
|
connect con1, localhost, u, good_pass;
|
|
disconnect con1;
|
|
connect(localhost,u,bad_pass,test,MASTER_PORT,MASTER_SOCKET);
|
|
connect con1, localhost, u, bad_pass;
|
|
ERROR 28000: Access denied for user 'u'@'localhost' (using password: YES)
|
|
connect con1, localhost, u, good_pass;
|
|
disconnect con1;
|
|
connect(localhost,u,bad_pass,test,MASTER_PORT,MASTER_SOCKET);
|
|
connect con1, localhost, u, bad_pass;
|
|
ERROR 28000: Access denied for user 'u'@'localhost' (using password: YES)
|
|
connect con1, localhost, u, good_pass;
|
|
ERROR 28000: Access denied for user 'u'@'localhost' (using password: YES)
|
|
ERROR 28000: Access denied for user 'u'@'localhost' (using password: YES)
|
|
ERROR HY000: User is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'
|
|
disconnect con1;
|
|
connection default;
|
|
FLUSH PRIVILEGES;
|
|
connect(localhost,root,bas_pass,test,MASTER_PORT,MASTER_SOCKET);
|
|
connect con1, localhost, root, bas_pass;
|
|
ERROR 28000: Access denied for user 'root'@'localhost' (using password: YES)
|
|
connect(localhost,root,bad_pass,test,MASTER_PORT,MASTER_SOCKET);
|
|
connect con1, localhost, root, bad_pass;
|
|
ERROR 28000: Access denied for user 'root'@'localhost' (using password: YES)
|
|
connect con1, localhost, u, good_pass;
|
|
disconnect con1;
|
|
connection default;
|
|
connect(localhost,u,bad_password,test,MASTER_PORT,MASTER_SOCKET);
|
|
connect con1, localhost, u, bad_password;
|
|
ERROR 28000: Access denied for user 'u'@'localhost' (using password: YES)
|
|
connect(localhost,u,bad_password,test,MASTER_PORT,MASTER_SOCKET);
|
|
connect con1, localhost, u, bad_password;
|
|
ERROR 28000: Access denied for user 'u'@'localhost' (using password: YES)
|
|
connect(localhost,u,good_pass,test,MASTER_PORT,MASTER_SOCKET);
|
|
connect con1, localhost, u, good_pass;
|
|
ERROR HY000: User is blocked because of too many credential errors; unblock with 'ALTER USER / FLUSH PRIVILEGES'
|
|
ALTER USER u ACCOUNT UNLOCK;
|
|
connect(localhost,u,bad_password,test,MASTER_PORT,MASTER_SOCKET);
|
|
connect con1, localhost, u, bad_password;
|
|
ERROR 28000: Access denied for user 'u'@'localhost' (using password: YES)
|
|
connect con1, localhost, u, good_pass;
|
|
disconnect con1;
|
|
connection default;
|
|
DROP USER u;
|
|
set global max_password_errors=@old_max_password_errors;
|