mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
MDEV-7656 init_file option does not allow changing passwords
allow SET PASSWORD from bootstrap and init-file
This commit is contained in:
parent
e257b8b959
commit
3e1c743d4a
3 changed files with 36 additions and 1 deletions
8
mysql-test/r/init_file_set_password-7656.result
Normal file
8
mysql-test/r/init_file_set_password-7656.result
Normal file
|
@ -0,0 +1,8 @@
|
|||
create user foo@localhost;
|
||||
select user,host,password from mysql.user where user='foo';
|
||||
user host password
|
||||
foo localhost
|
||||
select user,host,password from mysql.user where user='foo';
|
||||
user host password
|
||||
foo localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
|
||||
drop user foo@localhost;
|
26
mysql-test/t/init_file_set_password-7656.test
Normal file
26
mysql-test/t/init_file_set_password-7656.test
Normal file
|
@ -0,0 +1,26 @@
|
|||
#
|
||||
# MDEV-7656 init_file option does not allow changing passwords
|
||||
#
|
||||
--source include/not_embedded.inc
|
||||
|
||||
create user foo@localhost;
|
||||
|
||||
select user,host,password from mysql.user where user='foo';
|
||||
|
||||
--write_file $MYSQLTEST_VARDIR/init.file
|
||||
grant all on *.* to foo@localhost identified by 'test';
|
||||
EOF
|
||||
|
||||
--enable_reconnect
|
||||
|
||||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
|
||||
--shutdown_server 10
|
||||
--source include/wait_until_disconnected.inc
|
||||
|
||||
--exec echo "restart:--init-file=$MYSQLTEST_VARDIR/init.file " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
|
||||
--source include/wait_until_connected_again.inc
|
||||
select user,host,password from mysql.user where user='foo';
|
||||
|
||||
drop user foo@localhost;
|
|
@ -2558,7 +2558,8 @@ int check_change_password(THD *thd, const char *host, const char *user,
|
|||
my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables");
|
||||
return(1);
|
||||
}
|
||||
if (!thd->slave_thread && !thd->security_ctx->priv_user[0])
|
||||
if (!thd->slave_thread && !thd->security_ctx->priv_user[0] &&
|
||||
!in_bootstrap)
|
||||
{
|
||||
my_message(ER_PASSWORD_ANONYMOUS_USER, ER(ER_PASSWORD_ANONYMOUS_USER),
|
||||
MYF(0));
|
||||
|
|
Loading…
Reference in a new issue