mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
strict_password_validation
This commit is contained in:
@@ -58,6 +58,48 @@ set password for foo1 = password('qwe:123:4SD!');
|
||||
--error ER_NOT_VALID_PASSWORD
|
||||
set password for foo1 = old_password('qwe:123:ASD4');
|
||||
set password for foo1 = password('qwe:123:ASD!');
|
||||
|
||||
# now, strict_password_validation
|
||||
select @@strict_password_validation;
|
||||
|
||||
--error ER_NOT_VALID_PASSWORD
|
||||
set password for foo1 = '';
|
||||
--error ER_OPTION_PREVENTS_STATEMENT
|
||||
set password for foo1 = '2222222222222222';
|
||||
--error ER_OPTION_PREVENTS_STATEMENT
|
||||
set password for foo1 = '11111111111111111111111111111111111111111';
|
||||
--error ER_OPTION_PREVENTS_STATEMENT
|
||||
create user foo2 identified by password '11111111111111111111111111111111111111111';
|
||||
--error ER_OPTION_PREVENTS_STATEMENT
|
||||
grant select on *.* to foo2 identified by password '2222222222222222';
|
||||
--error ER_OPTION_PREVENTS_STATEMENT
|
||||
create user foo2 identified with mysql_native_password using '11111111111111111111111111111111111111111';
|
||||
--error ER_OPTION_PREVENTS_STATEMENT
|
||||
grant select on *.* to foo2 identified with mysql_old_password using '2222222222222222';
|
||||
--error ER_NOT_VALID_PASSWORD
|
||||
create user foo2 identified with mysql_native_password using '';
|
||||
--error ER_NOT_VALID_PASSWORD
|
||||
grant select on *.* to foo2 identified with mysql_old_password;
|
||||
|
||||
# direct updates are not protected
|
||||
update mysql.user set password='xxx' where user='foo1';
|
||||
|
||||
set global strict_password_validation=0;
|
||||
|
||||
--error ER_NOT_VALID_PASSWORD
|
||||
set password for foo1 = '';
|
||||
set password for foo1 = '2222222222222222';
|
||||
set password for foo1 = '11111111111111111111111111111111111111111';
|
||||
create user foo2 identified by password '11111111111111111111111111111111111111111';
|
||||
drop user foo2;
|
||||
grant select on *.* to foo2 identified by password '2222222222222222';
|
||||
drop user foo2;
|
||||
create user foo2 identified with mysql_native_password using '11111111111111111111111111111111111111111';
|
||||
drop user foo2;
|
||||
grant select on *.* to foo2 identified with mysql_old_password using '2222222222222222';
|
||||
drop user foo2;
|
||||
|
||||
set global strict_password_validation=1;
|
||||
drop user foo1;
|
||||
|
||||
uninstall plugin simple_password_check;
|
||||
|
||||
Reference in New Issue
Block a user