Skip to content

Commit c58df0c

Browse files
author
Alexander Barkov
committed
MDEV-14031 Password policy causes replication failure
1 parent 64e1dda commit c58df0c

File tree

3 files changed

+51
-1
lines changed

3 files changed

+51
-1
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
INSTALL SONAME "simple_password_check";
2+
SELECT PLUGIN_NAME FROM INFORMATION_SCHEMA.PLUGINS
3+
WHERE PLUGIN_NAME='simple_password_check';
4+
PLUGIN_NAME
5+
simple_password_check
6+
#
7+
# MDEV-14031 Password policy causes replication failure
8+
#
9+
CREATE USER user1@localhost IDENTIFIED BY 'BsG9#9.cem#!85';
10+
CREATE USER user2@localhost IDENTIFIED BY 'bsg9#d.cem#!85';
11+
ERROR HY000: Your password does not satisfy the current policy requirements
12+
DROP USER user1@localhost;
13+
include/show_binlog_events.inc
14+
Log_name Pos Event_type Server_id End_log_pos Info
15+
master-bin.000001 # Gtid # # GTID #-#-#
16+
master-bin.000001 # Query # # use `test`; CREATE USER user1@localhost IDENTIFIED BY 'BsG9#9.cem#!85'
17+
master-bin.000001 # Gtid # # GTID #-#-#
18+
master-bin.000001 # Query # # use `test`; DROP USER user1@localhost
19+
UNINSTALL PLUGIN simple_password_check;
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--source include/not_embedded.inc
2+
--source include/have_binlog_format_statement.inc
3+
4+
if (!$SIMPLE_PASSWORD_CHECK_SO) {
5+
skip No SIMPLE_PASSWORD_CHECK plugin;
6+
}
7+
8+
INSTALL SONAME "simple_password_check";
9+
SELECT PLUGIN_NAME FROM INFORMATION_SCHEMA.PLUGINS
10+
WHERE PLUGIN_NAME='simple_password_check';
11+
12+
13+
--echo #
14+
--echo # MDEV-14031 Password policy causes replication failure
15+
--echo #
16+
17+
--disable_query_log
18+
RESET MASTER; # get rid of previous tests binlog
19+
--enable_query_log
20+
21+
CREATE USER user1@localhost IDENTIFIED BY 'BsG9#9.cem#!85';
22+
23+
--error ER_NOT_VALID_PASSWORD
24+
CREATE USER user2@localhost IDENTIFIED BY 'bsg9#d.cem#!85';
25+
26+
DROP USER user1@localhost;
27+
28+
--let $binlog_file = LAST
29+
source include/show_binlog_events.inc;
30+
31+
UNINSTALL PLUGIN simple_password_check;

sql/sql_acl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9507,13 +9507,13 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list, bool handle_as_role)
95079507
}
95089508
}
95099509

9510-
binlog= true;
95119510
if (replace_user_table(thd, tables[USER_TABLE].table, *user_name, 0, 0, 1, 0))
95129511
{
95139512
append_user(thd, &wrong_users, user_name);
95149513
result= TRUE;
95159514
continue;
95169515
}
9516+
binlog= true;
95179517

95189518
// every created role is automatically granted to its creator-admin
95199519
if (handle_as_role)

0 commit comments

Comments
 (0)