From 4db2ebb1fe8454ea0f2a70d740fc2d9d9b408f0d Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 30 Apr 2016 09:09:10 +0200 Subject: [PATCH] MDEV-9940 CREATE ROLE blocked by password validation plugin --- mysql-test/suite/plugins/r/simple_password_check.result | 2 ++ mysql-test/suite/plugins/t/simple_password_check.test | 6 ++++++ sql/sql_acl.cc | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/plugins/r/simple_password_check.result b/mysql-test/suite/plugins/r/simple_password_check.result index a0b43a94137..c21298cea33 100644 --- a/mysql-test/suite/plugins/r/simple_password_check.result +++ b/mysql-test/suite/plugins/r/simple_password_check.result @@ -147,6 +147,8 @@ grant select on *.* to foo2 identified with mysql_old_password using '2222222222 drop user foo2; set global strict_password_validation=1; drop user foo1; +create role r1; +drop role r1; uninstall plugin simple_password_check; create user foo1 identified by 'pwd'; drop user foo1; diff --git a/mysql-test/suite/plugins/t/simple_password_check.test b/mysql-test/suite/plugins/t/simple_password_check.test index 9854f93efe8..bfe3464f5f9 100644 --- a/mysql-test/suite/plugins/t/simple_password_check.test +++ b/mysql-test/suite/plugins/t/simple_password_check.test @@ -103,6 +103,12 @@ drop user foo2; set global strict_password_validation=1; drop user foo1; +# +# MDEV-9940 CREATE ROLE blocked by password validation plugin +# +create role r1; +drop role r1; + uninstall plugin simple_password_check; create user foo1 identified by 'pwd'; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index d168529df37..95b90c263ee 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -3458,7 +3458,7 @@ static int replace_user_table(THD *thd, TABLE *table, LEX_USER &combo, } if (!old_row_exists || combo.pwtext.length || combo.pwhash.length) - if (validate_password(&combo)) + if (!handle_as_role && validate_password(&combo)) goto end; /* Update table columns with new privileges */