mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-7597 Expiration of user passwords
This patch adds support for expiring user passwords. The following statements are extended: CREATE USER user@localhost PASSWORD EXPIRE [option] ALTER USER user@localhost PASSWORD EXPIRE [option] If no option is specified, the password is expired with immediate effect. If option is DEFAULT, global policy applies according to the default_password_lifetime system var (if 0, password never expires, if N, password expires every N days). If option is NEVER, the password never expires and if option is INTERVAL N DAY, the password expires every N days. The feature also supports the disconnect_on_expired_password system var and the --connect-expired-password client option. Closes #1166
This commit is contained in:
committed by
Sergei Golubchik
parent
83de75d66d
commit
90ad4dbd17
@ -186,5 +186,38 @@ show create user user1@localhost;
|
||||
CREATE USER for user1@localhost
|
||||
CREATE USER 'user1'@'localhost'
|
||||
#
|
||||
# Test password expiration fields are loaded correctly
|
||||
#
|
||||
create user user@localhost;
|
||||
show create user user@localhost;
|
||||
CREATE USER for user@localhost
|
||||
CREATE USER 'user'@'localhost'
|
||||
alter user user@localhost password expire;
|
||||
show create user user@localhost;
|
||||
CREATE USER for user@localhost
|
||||
CREATE USER 'user'@'localhost' PASSWORD EXPIRE
|
||||
set password for user@localhost= password('');
|
||||
alter user user@localhost password expire default;
|
||||
show create user user@localhost;
|
||||
CREATE USER for user@localhost
|
||||
CREATE USER 'user'@'localhost'
|
||||
alter user user@localhost password expire never;
|
||||
show create user user@localhost;
|
||||
CREATE USER for user@localhost
|
||||
CREATE USER 'user'@'localhost' PASSWORD EXPIRE NEVER
|
||||
alter user user@localhost password expire interval 123 day;
|
||||
show create user user@localhost;
|
||||
CREATE USER for user@localhost
|
||||
CREATE USER 'user'@'localhost' PASSWORD EXPIRE INTERVAL 123 DAY
|
||||
alter user user@localhost password expire;
|
||||
show create user user@localhost;
|
||||
CREATE USER for user@localhost
|
||||
CREATE USER 'user'@'localhost' PASSWORD EXPIRE
|
||||
set password for user@localhost= password('');
|
||||
show create user user@localhost;
|
||||
CREATE USER for user@localhost
|
||||
CREATE USER 'user'@'localhost' PASSWORD EXPIRE INTERVAL 123 DAY
|
||||
drop user user@localhost;
|
||||
#
|
||||
# Reset to final original state.
|
||||
#
|
||||
|
Reference in New Issue
Block a user