diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-10-22 07:23:59 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-10-22 07:23:59 +0200 |
commit | 3e1c743d4a100ff13efd030422525b28d1877281 (patch) | |
tree | 75901e22e5f7f57a6101d79f929199ecf4052c88 | |
parent | e257b8b9598ff861a97bbc2c43e2d7e88a997523 (diff) | |
download | mariadb-git-3e1c743d4a100ff13efd030422525b28d1877281.tar.gz |
MDEV-7656 init_file option does not allow changing passwords
allow SET PASSWORD from bootstrap and init-file
-rw-r--r-- | mysql-test/r/init_file_set_password-7656.result | 8 | ||||
-rw-r--r-- | mysql-test/t/init_file_set_password-7656.test | 26 | ||||
-rw-r--r-- | sql/sql_acl.cc | 3 |
3 files changed, 36 insertions, 1 deletions
diff --git a/mysql-test/r/init_file_set_password-7656.result b/mysql-test/r/init_file_set_password-7656.result new file mode 100644 index 00000000000..e5b3fc75706 --- /dev/null +++ b/mysql-test/r/init_file_set_password-7656.result @@ -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; diff --git a/mysql-test/t/init_file_set_password-7656.test b/mysql-test/t/init_file_set_password-7656.test new file mode 100644 index 00000000000..ecee3924355 --- /dev/null +++ b/mysql-test/t/init_file_set_password-7656.test @@ -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; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 7d0fefeabd4..e2fb35254af 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -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)); |