mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-13095 Implement User Account locking
Add server support for user account locking. This patch extends the ALTER/CREATE USER statements for denying a user's subsequent login attempts: ALTER USER user [, user2] ACCOUNT [LOCK | UNLOCK] CREATE USER user [, user2] ACCOUNT [LOCK | UNLOCK] The SHOW CREATE USER statement was updated to display the locking state of an user. Closes #1006
This commit is contained in:
committed by
Sergei Golubchik
parent
d89cdfc229
commit
6c8ce999f8
@ -2939,6 +2939,27 @@ public:
|
||||
Explain_delete* save_explain_delete_data(MEM_ROOT *mem_root, THD *thd);
|
||||
};
|
||||
|
||||
enum account_lock_type
|
||||
{
|
||||
ACCOUNTLOCK_UNSPECIFIED,
|
||||
ACCOUNTLOCK_LOCKED,
|
||||
ACCOUNTLOCK_UNLOCKED
|
||||
};
|
||||
|
||||
struct Account_options
|
||||
{
|
||||
Account_options()
|
||||
: account_locked(ACCOUNTLOCK_UNSPECIFIED)
|
||||
{ }
|
||||
|
||||
void reset()
|
||||
{
|
||||
account_locked= ACCOUNTLOCK_UNSPECIFIED;
|
||||
}
|
||||
|
||||
account_lock_type account_locked;
|
||||
};
|
||||
|
||||
|
||||
class Query_arena_memroot;
|
||||
/* The state of the lex parsing. This is saved in the THD struct */
|
||||
@ -3030,6 +3051,9 @@ public:
|
||||
*/
|
||||
LEX_USER *definer;
|
||||
|
||||
/* Used in ALTER/CREATE user to store account locking options */
|
||||
Account_options account_options;
|
||||
|
||||
Table_type table_type; /* Used for SHOW CREATE */
|
||||
List<Key_part_spec> ref_list;
|
||||
List<LEX_USER> users_list;
|
||||
|
Reference in New Issue
Block a user