mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
don't consider the password "expired" if authentication is passwordless
This commit is contained in:
parent
1e6210161d
commit
a94b20a8e0
3 changed files with 35 additions and 2 deletions
8
mysql-test/main/password_expiration_unix_socket.result
Normal file
8
mysql-test/main/password_expiration_unix_socket.result
Normal file
|
@ -0,0 +1,8 @@
|
|||
#
|
||||
# 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;
|
24
mysql-test/main/password_expiration_unix_socket.test
Normal file
24
mysql-test/main/password_expiration_unix_socket.test
Normal file
|
@ -0,0 +1,24 @@
|
|||
#
|
||||
# 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)
|
||||
|
|
Loading…
Add table
Reference in a new issue