summaryrefslogtreecommitdiff
path: root/mysql-test/suite/plugins/t/simple_password_check.test
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2014-11-25 18:47:44 +0100
committerSergei Golubchik <serg@mariadb.org>2014-12-04 10:41:55 +0100
commit7516a3c7f44fe45aaa6599c7e3135c7ef4f1c9ef (patch)
treed8356aa78a5b1fca3854282496338aaac3fc8550 /mysql-test/suite/plugins/t/simple_password_check.test
parentb81404671998009c25a56cc83aa7bf098ef9d964 (diff)
downloadmariadb-git-7516a3c7f44fe45aaa6599c7e3135c7ef4f1c9ef.tar.gz
strict_password_validation
Diffstat (limited to 'mysql-test/suite/plugins/t/simple_password_check.test')
-rw-r--r--mysql-test/suite/plugins/t/simple_password_check.test42
1 files changed, 42 insertions, 0 deletions
diff --git a/mysql-test/suite/plugins/t/simple_password_check.test b/mysql-test/suite/plugins/t/simple_password_check.test
index c322bebdfe3..c31e31154e3 100644
--- a/mysql-test/suite/plugins/t/simple_password_check.test
+++ b/mysql-test/suite/plugins/t/simple_password_check.test
@@ -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;