Commit a94b20a8 authored by Sergei Golubchik's avatar Sergei Golubchik

don't consider the password "expired" if authentication is passwordless

parent 1e621016
#
# A password cannot expire, if there is no password
#
create user USER identified via unix_socket;
alter user USER password expire;
1
1
drop user USER;
#
# Test password expiration
#
--source include/not_embedded.inc
--source include/have_unix_socket.inc
--echo #
--echo # A password cannot expire, if there is no password
--echo #
--let $replace=create user $USER
--replace_result $replace "create user USER"
--eval create user $USER identified via unix_socket
--let $replace=alter user $USER
--replace_result $replace "alter user USER"
--eval alter user $USER password expire
--exec $MYSQL -u $USER -e 'select 1'
--let $replace=drop user $USER
--replace_result $replace "drop user USER"
--eval drop user $USER
......@@ -13843,8 +13843,9 @@ bool acl_authenticate(THD *thd, uint com_change_user_pkt_len)
bool client_can_handle_exp_pass= thd->client_capabilities &
CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS;
bool password_expired= acl_user->password_expired ||
check_password_lifetime(thd, *acl_user);
bool password_expired= thd->password != PASSWORD_USED_NO_MENTION
&& (acl_user->password_expired ||
check_password_lifetime(thd, *acl_user));
if (!client_can_handle_exp_pass && disconnect_on_expired_password &&
password_expired)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment