MySQL 8.4.4
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
ACL_temporary_lock_state Class Reference

Enables preserving temporary account locking attributes during ACL DDL. More...

#include <sql_auth_cache.h>

Public Member Functions

 ACL_temporary_lock_state (const char *host, const char *user, uint remaining_login_attempts, long daynr_locked)
 

Static Public Member Functions

static bool is_modified (ACL_USER *acl_user)
 
static ACL_USERpreserve_user_lock_state (const char *host, const char *user, Lock_state_list &user_list)
 Enables preserving temporary account locking attributes of a user during ACL DDL. More...
 
static void restore_user_lock_state (const char *host, const char *user, uint remaining_login_attempts, long daynr_locked)
 Enables restoring temporary account locking attributes of a user after ACL reload. More...
 
static void restore_temporary_account_locking (Prealloced_array< ACL_USER, ACL_PREALLOC_SIZE > *old_acl_users, Lock_state_list *modified_user_lock_state_list)
 Enables restoring temporary account locking attributes of all users after ACL reload. More...
 

Private Attributes

const char * m_host
 
const char * m_user
 
const uint m_remaining_login_attempts
 
const long m_daynr_locked
 

Detailed Description

Enables preserving temporary account locking attributes during ACL DDL.

Enables restoring temporary account locking attributes after ACL reload.

This class is used to preserve the state of the accounts being altered by the current ACL statement. The account locking data needs to be preserved since the current state of account locking is not stored into the table and can't be restored from it when the code needs to re-create the ACL caches from the tables.

When an ACL DDL statement that can modify account locking data starts, a new instance of this class is created and the current in-memory account locking data is preserved for each user that is modified by the statement, if account locking data is not default.

ACL DDL rollback results in the in-memory ACL cache being re-created during ACL reload.

After ACL reload:

  • For all users in the new ACL cache, the temporary account locking state is restored from the old ACL cache, if account locking data is not default.
  • For specific users in the new ACL cache, the temporary account locking state is restored from the instances of this class that were created at the start of the ACL DDL statement. This needs to be done since these accounts could be dropped (mysql_drop_user), renamed (mysql_rename_user) or altered (mysql_alter_user) in the old ACL cache.

Constructor & Destructor Documentation

◆ ACL_temporary_lock_state()

ACL_temporary_lock_state::ACL_temporary_lock_state ( const char *  host,
const char *  user,
uint  remaining_login_attempts,
long  daynr_locked 
)

Member Function Documentation

◆ is_modified()

bool ACL_temporary_lock_state::is_modified ( ACL_USER acl_user)
static

◆ preserve_user_lock_state()

ACL_USER * ACL_temporary_lock_state::preserve_user_lock_state ( const char *  host,
const char *  user,
Lock_state_list user_list 
)
static

Enables preserving temporary account locking attributes of a user during ACL DDL.

ACL_temporary_lock_state

Parameters
[in]hostAccount's hostname.
[in]userAccount's username.
[out]user_listList in which a user's lock state is preserved.
Returns
find_acl_user(host, user, true)

◆ restore_temporary_account_locking()

void ACL_temporary_lock_state::restore_temporary_account_locking ( Prealloced_array< ACL_USER, ACL_PREALLOC_SIZE > *  old_acl_users,
Lock_state_list modified_user_lock_state_list 
)
static

Enables restoring temporary account locking attributes of all users after ACL reload.

ACL_temporary_lock_state

Parameters
[in]old_acl_usersList of users in the old ACL cache.
[in]modified_user_lock_state_listList of users whose temporary account locking attributes are likely modified.

◆ restore_user_lock_state()

void ACL_temporary_lock_state::restore_user_lock_state ( const char *  host,
const char *  user,
uint  remaining_login_attempts,
long  daynr_locked 
)
static

Enables restoring temporary account locking attributes of a user after ACL reload.

ACL_temporary_lock_state

Parameters
[in]hostAccount's hostname.
[in]userAccount's username.
[in]remaining_login_attemptsAccount's remaining login attempts.
[in]daynr_lockedAccount's locked day.

Member Data Documentation

◆ m_daynr_locked

const long ACL_temporary_lock_state::m_daynr_locked
private

◆ m_host

const char* ACL_temporary_lock_state::m_host
private

◆ m_remaining_login_attempts

const uint ACL_temporary_lock_state::m_remaining_login_attempts
private

◆ m_user

const char* ACL_temporary_lock_state::m_user
private

The documentation for this class was generated from the following files: