Skip to content

Commit

Permalink
MDEV-9940 CREATE ROLE blocked by password validation plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed May 4, 2016
1 parent 357f4d8 commit 4db2ebb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions mysql-test/suite/plugins/r/simple_password_check.result
Original file line number Diff line number Diff line change
Expand Up @@ -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;
6 changes: 6 additions & 0 deletions mysql-test/suite/plugins/t/simple_password_check.test
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion sql/sql_acl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 4db2ebb

Please sign in to comment.