From: Kristofer Pettersson Date: November 1 2012 8:36am Subject: bzr push into mysql-trunk branch (kristofer.pettersson:4875 to 4876) List-Archive: http://lists.mysql.com/commits/145129 Message-Id: <20121101083657.3004.61637.4876@ghost> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 4876 Kristofer Pettersson 2012-11-01 [merge] merge 5.6=> trunk modified: mysql-test/r/plugin_auth_sha256_tls.result mysql-test/t/plugin_auth_sha256_tls.test sql/sql_acl.cc sql/sql_parse.cc 4875 Tor Didriksen 2012-10-31 [merge] merge 5.6 => trunk modified: unittest/gunit/sql_table-t.cc === modified file 'mysql-test/r/plugin_auth_sha256_tls.result' --- a/mysql-test/r/plugin_auth_sha256_tls.result 2012-05-31 11:48:21 +0000 +++ b/mysql-test/r/plugin_auth_sha256_tls.result 2012-10-31 15:42:45 +0000 @@ -29,4 +29,17 @@ SET PASSWORD FOR 'kristofer'@'33.33.33.3 Connection should fail for localhost ERROR 28000: Access denied for user 'kristofer'@'localhost' (using password: NO) DROP USER 'kristofer'@'33.33.33.33'; +# +# BUG14807074 ALTER USER PASSWORD EXPIRE VS SHA256_PASSWORD +# +CREATE USER 'u1'@'localhost' IDENTIFIED WITH 'sha256_password'; +SET PASSWORD FOR 'u1'@'localhost' = PASSWORD('pass'); +ALTER USER 'u1'@'localhost' PASSWORD EXPIRE; +SELECT * FROM t1; +ERROR HY000: You must SET PASSWORD before executing this statement +SET @@OLD_PASSWORDS=2; +SET PASSWORD=PASSWORD('pass2'); +SELECT * FROM no_such_table; +ERROR 42S02: Table 'test.no_such_table' doesn't exist +DROP USER 'u1'@'localhost'; SET GLOBAL old_passwords= default; === modified file 'mysql-test/t/plugin_auth_sha256_tls.test' --- a/mysql-test/t/plugin_auth_sha256_tls.test 2012-05-31 11:48:21 +0000 +++ b/mysql-test/t/plugin_auth_sha256_tls.test 2012-10-31 15:42:45 +0000 @@ -43,6 +43,28 @@ SET PASSWORD FOR 'kristofer'@'33.33.33.3 connect(con4,127.0.0.1,kristofer,,,,,SSL); --enable_query_log DROP USER 'kristofer'@'33.33.33.33'; + +--echo # +--echo # BUG14807074 ALTER USER PASSWORD EXPIRE VS SHA256_PASSWORD +--echo # +CREATE USER 'u1'@'localhost' IDENTIFIED WITH 'sha256_password'; +SET PASSWORD FOR 'u1'@'localhost' = PASSWORD('pass'); +ALTER USER 'u1'@'localhost' PASSWORD EXPIRE; +connect(con5,127.0.0.1,u1,pass,test,,,SSL); +--error ER_MUST_CHANGE_PASSWORD +SELECT * FROM t1; +SET @@OLD_PASSWORDS=2; +SET PASSWORD=PASSWORD('pass2'); + +connect(con6,127.0.0.1,u1,pass2,test,,,SSL); +--error ER_NO_SUCH_TABLE +SELECT * FROM no_such_table; + +connection default; +DROP USER 'u1'@'localhost'; +disconnect con5; +disconnect con6; + # Restore default value to old_passwords SET GLOBAL old_passwords= default; connection default; === modified file 'sql/sql_acl.cc' --- a/sql/sql_acl.cc 2012-10-31 08:28:46 +0000 +++ b/sql/sql_acl.cc 2012-11-01 08:35:35 +0000 @@ -2308,6 +2308,12 @@ bool change_password(THD *thd, const cha new_password, new_password_len + 1); acl_user->auth_string.length= new_password_len; + /* + Since we're changing the password for the user we need to reset the + expiration flag. + */ + acl_user->password_expired= false; + thd->security_ctx->password_expired= false; } } else { === modified file 'sql/sql_parse.cc' --- a/sql/sql_parse.cc 2012-10-31 08:28:46 +0000 +++ b/sql/sql_parse.cc 2012-11-01 08:35:35 +0000 @@ -6063,8 +6063,9 @@ void mysql_parse(THD *thd, char *rawbuf, &thd->security_ctx->priv_user[0], (char *) thd->security_ctx->host_or_ip, 0); - if (unlikely(thd->security_ctx->password_expired && - !lex->is_change_password)) + if (unlikely(thd->security_ctx->password_expired && + !lex->is_change_password && + lex->sql_command != SQLCOM_SET_OPTION)) { my_error(ER_MUST_CHANGE_PASSWORD, MYF(0)); error= 1; No bundle (reason: useless for push emails).