mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-24114 SHOW CREATE USER doesnt display correct password expiry status
Given PASSWORD EXPIRE and PASSWORD EXPIRE [NEVER|INTERVAL x DAY] are two different mechanisms, SHOW CREATE USER should display all the information required to restore the state of an account which includes both a manual expired state and an automatic policy. The solution proposed here keeps a CREATE USER ... PASSWORD EXPIRE statement and adds an aditional ALTER USER .. PASSWORD EXPIRE [NEVER|INTERVAL x DAY] when necessary This way a tool can restore almost the complete state of an account as it was before a dump. The only information left still is the value of the password_last_changed column from mysql.global_priv
This commit is contained in:
@ -156,6 +156,7 @@ alter user user1@localhost PASSWORD EXPIRE NEVER ACCOUNT UNLOCK ;
|
||||
show create user user1@localhost;
|
||||
CREATE USER for user1@localhost
|
||||
CREATE USER `user1`@`localhost` PASSWORD EXPIRE
|
||||
ALTER USER `user1`@`localhost` PASSWORD EXPIRE NEVER
|
||||
alter user user1@localhost ACCOUNT LOCK PASSWORD EXPIRE DEFAULT;
|
||||
show create user user1@localhost;
|
||||
CREATE USER for user1@localhost
|
||||
@ -167,5 +168,6 @@ localhost user1 {"access":0,"plugin":"mysql_native_password","authentication_str
|
||||
show create user user1@localhost;
|
||||
CREATE USER for user1@localhost
|
||||
CREATE USER `user1`@`localhost` PASSWORD EXPIRE
|
||||
ALTER USER `user1`@`localhost` PASSWORD EXPIRE INTERVAL 60 DAY
|
||||
drop user user1@localhost;
|
||||
drop user user2@localhost;
|
||||
|
Reference in New Issue
Block a user