23#ifndef SQL_USER_CACHE_INCLUDED
24#define SQL_USER_CACHE_INCLUDED
30#include <boost/graph/adjacency_list.hpp>
31#include <boost/graph/graph_selectors.hpp>
32#include <boost/graph/graph_traits.hpp>
33#include <boost/graph/properties.hpp>
34#include <boost/pending/property.hpp>
38#include <unordered_map>
67template <
typename Element_type,
size_t Prealloc>
122 static bool calc_ip_mask(
const char *ip_arg,
long *val);
134 static const char *
calc_ip(
const char *ip_arg,
long *val);
221#define NUM_CREDENTIALS 2
222#define PRIMARY_CRED (NUM_CREDENTIALS - NUM_CREDENTIALS)
223#define SECOND_CRED (PRIMARY_CRED + 1)
319 bool update(
THD *thd,
bool successful_login,
long *ret_days_remaining);
374 void init(
const char *host_arg,
const char *user_arg,
375 const char *proxied_host_arg,
const char *proxied_user_arg,
376 bool with_grant_arg);
379 const char *proxied_host_arg,
const char *proxied_user_arg,
380 bool with_grant_arg);
393 bool matches(
const char *host_arg,
const char *user_arg,
const char *ip_arg,
394 const char *proxied_user_arg,
bool any_proxy_user);
397 return (a == b || (a !=
nullptr && b !=
nullptr && !strcmp(a, b)));
402 bool granted_on(
const char *host_arg,
const char *user_arg) {
404 ((!
user && (!user_arg || !user_arg[0])) ||
405 (
user && user_arg && !strcmp(
user, user_arg))) &&
424 const char *grantor);
456 GRANT_NAME(
const char *h,
const char *d,
const char *u,
const char *t,
462 const char *t,
bool is_routine);
472 GRANT_TABLE(
const char *h,
const char *d,
const char *u,
const char *t,
535 const char *
host,
const char *ip,
const char *db,
const char *
user,
536 const char *tname,
bool exact,
bool name_tolower) {
539 std::string
name = tname;
548 auto it_range = name_hash.equal_range(
key);
549 for (
auto it = it_range.first; it != it_range.second; ++it) {
550 T *grant_name = it->second.get();
552 if (!grant_name->host.get_host() ||
554 grant_name->host.get_host())) ||
555 (ip && !strcmp(ip, grant_name->host.get_host())))
558 if (grant_name->host.compare_hostname(
host, ip) &&
559 (!found || found->sort < grant_name->sort))
567 const char *db,
const char *
user,
568 const char *tname,
bool proc,
572 db,
user, tname, exact,
true);
576 const char *db,
const char *
user,
577 const char *tname,
bool exact) {
603 boost::property<boost::vertex_name_t, std::string>>
609typedef boost::adjacency_list<boost::setS,
611 boost::bidirectionalS,
617typedef boost::graph_traits<Granted_roles_graph>::vertex_descriptor
621typedef boost::graph_traits<Granted_roles_graph>::edge_descriptor
629using degree_s_t = boost::graph_traits<Granted_roles_graph>::degree_size_type;
633 boost::graph_traits<Granted_roles_graph>::out_edge_iterator;
637 boost::graph_traits<Granted_roles_graph>::in_edge_iterator;
651 void *
operator new(
size_t size);
652 void operator delete(
void *
p);
777 bool lock(
bool raise_error =
true);
uint32_t Access_bitmask
Definition: auth_acls.h:34
std::pair< LEX_CSTRING, LEX_CSTRING > Auth_id_ref
user, host tuple which reference either acl_cache or g_default_roles
Definition: auth_common.h:80
std::vector< Auth_id_ref > List_of_auth_id_refs
Definition: auth_common.h:81
std::map< std::string, Access_bitmask > SP_access_map
Definition: auth_internal.h:65
std::map< std::string, Access_bitmask > Db_access_map
Definition: auth_internal.h:66
std::map< std::string, bool > Dynamic_privileges
Definition: auth_internal.h:279
std::unordered_set< std::string > Grant_acl_set
Definition: auth_internal.h:90
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
Definition: sql_auth_cache.h:160
Access_bitmask access
Definition: sql_auth_cache.h:165
ACL_HOST_AND_IP host
Definition: sql_auth_cache.h:163
ACL_ACCESS()
Definition: sql_auth_cache.h:162
ulong sort
Definition: sql_auth_cache.h:164
Definition: sql_auth_cache.h:347
char * user
Definition: sql_auth_cache.h:349
char * db
Definition: sql_auth_cache.h:349
void set_user(MEM_ROOT *mem, const char *user_arg)
Definition: sql_auth_cache.cc:682
void set_host(MEM_ROOT *mem, const char *host_arg)
Definition: sql_auth_cache.cc:686
Definition: sql_auth_cache.h:74
bool check_allow_all_hosts()
Definition: sql_auth_cache.h:151
bool has_wildcard()
Definition: sql_auth_cache.h:146
static bool calc_cidr_mask(const char *ip_arg, long *val)
IP mask parsing in the CIDR format.
Definition: sql_auth_cache.cc:227
long ip_mask
Definition: sql_auth_cache.h:96
size_t get_host_len() const
Definition: sql_auth_cache.h:144
enum_ip_mask_type
IP mask type enum.
Definition: sql_auth_cache.h:79
@ ip_mask_type_cidr
IP specified with a mask in a CIDR form.
Definition: sql_auth_cache.h:87
@ ip_mask_type_subnet
IP specified with a mask in a form of a subnet.
Definition: sql_auth_cache.h:91
@ ip_mask_type_implicit
Only IP is specified.
Definition: sql_auth_cache.h:83
static const char * calc_ip(const char *ip_arg, long *val)
IP parsing.
Definition: sql_auth_cache.cc:250
long ip
Definition: sql_auth_cache.h:96
static bool calc_ip_mask(const char *ip_arg, long *val)
IP mask parsing in the subnet format.
Definition: sql_auth_cache.cc:238
size_t hostname_length
Definition: sql_auth_cache.h:95
void update_hostname(const char *host_arg)
Update the hostname.
Definition: sql_auth_cache.cc:271
ACL_HOST_AND_IP()
Definition: sql_auth_cache.h:137
const char * get_host() const
Definition: sql_auth_cache.h:143
enum_ip_mask_type ip_mask_type
IP mask type.
Definition: sql_auth_cache.h:100
const char * hostname
Definition: sql_auth_cache.h:94
bool compare_hostname(const char *host_arg, const char *ip_arg)
Definition: sql_auth_cache.cc:323
Definition: sql_auth_cache.h:216
char * db
Definition: sql_auth_cache.h:218
Definition: sql_auth_cache.h:355
ACL_HOST_AND_IP proxied_host
Definition: sql_auth_cache.h:357
static int store_data_record(TABLE *table, const LEX_CSTRING &host, const LEX_CSTRING &user, const LEX_CSTRING &proxied_host, const LEX_CSTRING &proxied_user, bool with_grant, const char *grantor)
Definition: sql_auth_cache.cc:656
bool get_with_grant()
Definition: sql_auth_cache.h:384
const char * get_proxied_host()
Definition: sql_auth_cache.h:387
void print_grant(THD *thd, String *str)
Definition: sql_auth_cache.cc:609
bool matches(const char *host_arg, const char *user_arg, const char *ip_arg, const char *proxied_user_arg, bool any_proxy_user)
Definition: sql_auth_cache.cc:560
const char * get_user()
Definition: sql_auth_cache.h:385
void set_host(MEM_ROOT *mem, const char *host_arg)
Definition: sql_auth_cache.cc:678
size_t get_proxied_user_length() const
Definition: sql_auth_cache.h:428
size_t get_user_length() const
Definition: sql_auth_cache.h:426
void init(const char *host_arg, const char *user_arg, const char *proxied_host_arg, const char *proxied_user_arg, bool with_grant_arg)
Definition: sql_auth_cache.cc:511
static int store_pk(TABLE *table, const LEX_CSTRING &host, const LEX_CSTRING &user, const LEX_CSTRING &proxied_host, const LEX_CSTRING &proxied_user)
Definition: sql_auth_cache.cc:620
bool pk_equals(ACL_PROXY_USER *grant)
Definition: sql_auth_cache.cc:586
bool check_validity(bool check_no_resolve)
Definition: sql_auth_cache.cc:547
static bool auth_element_equals(const char *a, const char *b)
Definition: sql_auth_cache.h:396
void set_user(MEM_ROOT *mem, const char *user_arg)
Definition: sql_auth_cache.cc:674
static int store_with_grant(TABLE *table, bool with_grant)
Definition: sql_auth_cache.cc:646
void set_data(ACL_PROXY_USER *grant)
Definition: sql_auth_cache.h:412
old_acl_proxy_users
Definition: sql_auth_cache.h:361
@ MYSQL_PROXIES_PRIV_PROXIED_HOST
Definition: sql_auth_cache.h:364
@ MYSQL_PROXIES_PRIV_HOST
Definition: sql_auth_cache.h:362
@ MYSQL_PROXIES_PRIV_WITH_GRANT
Definition: sql_auth_cache.h:366
@ MYSQL_PROXIES_PRIV_GRANTOR
Definition: sql_auth_cache.h:367
@ MYSQL_PROXIES_PRIV_PROXIED_USER
Definition: sql_auth_cache.h:365
@ MYSQL_PROXIES_PRIV_TIMESTAMP
Definition: sql_auth_cache.h:368
@ MYSQL_PROXIES_PRIV_USER
Definition: sql_auth_cache.h:363
const char * proxied_user
Definition: sql_auth_cache.h:358
const char * get_proxied_user()
Definition: sql_auth_cache.h:386
const char * user
Definition: sql_auth_cache.h:356
bool granted_on(const char *host_arg, const char *user_arg)
Definition: sql_auth_cache.h:402
bool with_grant
Definition: sql_auth_cache.h:359
Definition: sql_auth_cache.h:308
Password_locked_state()
Definition: sql_auth_cache.h:320
void set_parameters(uint password_lock_time_days, uint failed_login_attempts)
Definition: sql_auth_cache.cc:375
int m_password_lock_time_days
read from the user config.
Definition: sql_auth_cache.h:330
uint get_failed_login_attempts() const
Definition: sql_auth_cache.h:316
bool is_active() const
Definition: sql_auth_cache.h:310
uint m_remaining_login_attempts
The remaining login tries, valid only if m_failed_login_attempts and m_password_lock_time_days are no...
Definition: sql_auth_cache.h:340
long m_daynr_locked
The day the account is locked, 0 if not locked.
Definition: sql_auth_cache.h:342
uint m_failed_login_attempts
read from the user config.
Definition: sql_auth_cache.h:335
int get_password_lock_time_days() const
Definition: sql_auth_cache.h:313
bool update(THD *thd, bool successful_login, long *ret_days_remaining)
Updates the password locked state based on the time of day fetched from the THD.
Definition: sql_auth_cache.cc:393
Class that compares ACL_USER objects.
Definition: sql_auth_cache.h:195
bool operator()(const ACL_USER &a, const ACL_USER &b)
Determine sort order of two user accounts.
Definition: sql_auth_cache.cc:3769
Definition: sql_auth_cache.h:247
bool account_locked
Specifies whether the user account is locked or unlocked.
Definition: sql_auth_cache.h:262
Acl_credential credentials[NUM_CREDENTIALS]
Additional credentials.
Definition: sql_auth_cache.h:299
void set_mfa(MEM_ROOT *mem, I_multi_factor_auth *m)
Definition: sql_auth_cache.cc:493
MYSQL_TIME password_last_changed
Definition: sql_auth_cache.h:256
bool use_default_password_reuse_interval
Ignore password_reuse_interval, use the global default global_password_reuse_interval.
Definition: sql_auth_cache.h:289
uint password_lifetime
Definition: sql_auth_cache.h:257
Lex_acl_attrib_udyn password_require_current
The current password needed to be specified while changing it.
Definition: sql_auth_cache.h:294
bool can_authenticate
Definition: sql_auth_cache.h:255
bool is_role
If this ACL_USER was used as a role id then this flag is true.
Definition: sql_auth_cache.h:268
void set_host(MEM_ROOT *mem, const char *host_arg)
Definition: sql_auth_cache.cc:489
LEX_CSTRING plugin
Definition: sql_auth_cache.h:253
bool use_default_password_history
Ignore password_history_length, use the global default global_password_history.
Definition: sql_auth_cache.h:279
ACL_USER()
Definition: sql_auth_cache.cc:337
enum SSL_type ssl_type
Definition: sql_auth_cache.h:251
const char * x509_subject
Definition: sql_auth_cache.h:252
const char * ssl_cipher
Definition: sql_auth_cache.h:252
size_t get_username_length() const
Definition: sql_auth_cache.h:307
uint32 password_reuse_interval
The number of days that would have to pass before a password can be reused.
Definition: sql_auth_cache.h:284
I_multi_factor_auth * m_mfa
Definition: sql_auth_cache.h:344
bool password_expired
Definition: sql_auth_cache.h:254
USER_RESOURCES user_resource
Definition: sql_auth_cache.h:249
void set_user(MEM_ROOT *mem, const char *user_arg)
Definition: sql_auth_cache.cc:485
class ACL_USER::Password_locked_state password_locked_state
char * user
Definition: sql_auth_cache.h:250
const char * x509_issuer
Definition: sql_auth_cache.h:252
bool use_default_password_lifetime
Definition: sql_auth_cache.h:258
uint32 password_history_length
The number of old passwords to check when setting a new password.
Definition: sql_auth_cache.h:273
ACL_USER * copy(MEM_ROOT *root)
Definition: sql_auth_cache.cc:451
Class that compares ACL_ACCESS objects.
Definition: sql_auth_cache.h:173
bool operator()(const ACL_ACCESS &a, const ACL_ACCESS &b)
Determine sort order of two user accounts.
Definition: sql_auth_cache.cc:3739
Definition: sql_auth_cache.h:488
Acl_cache_allocator(const Acl_cache_allocator< U > &other)
Definition: sql_auth_cache.h:497
Acl_cache_allocator & operator=(const Acl_cache_allocator< U > &other)
Definition: sql_auth_cache.h:501
Acl_cache_allocator()
Definition: sql_auth_cache.h:490
Lock guard for ACL Cache.
Definition: sql_auth_cache.h:766
Acl_cache_lock_guard(THD *thd, Acl_cache_lock_mode mode)
Acl_cache_lock_guard constructor.
Definition: sql_auth_cache.cc:3531
Acl_cache_lock_mode m_mode
Lock mode.
Definition: sql_auth_cache.h:787
bool lock(bool raise_error=true)
Explicitly take lock on Acl_cache_lock_cache object.
Definition: sql_auth_cache.cc:3547
void unlock()
Explicitly unlock all acquired locks.
Definition: sql_auth_cache.cc:3577
~Acl_cache_lock_guard()
Acl_cache_lock_guard destructor.
Definition: sql_auth_cache.h:775
bool already_locked()
Check whether lock is already obtained or not.
Definition: sql_auth_cache.cc:3609
bool m_locked
Lock status.
Definition: sql_auth_cache.h:789
THD * m_thd
Handle to THD object.
Definition: sql_auth_cache.h:785
Definition: sql_auth_cache.h:685
int32 size()
Return a snapshot of the number of items in the cache.
Definition: sql_auth_cache.cc:3331
void increase_version()
When ever the role graph is modified we must flatten the privileges again.
Definition: sql_auth_cache.cc:3323
uint64 version()
Return a lower boundary to the current version count.
Definition: sql_auth_cache.cc:3329
~Acl_cache()
Definition: sql_auth_cache.cc:3245
Acl_map * create_acl_map(uint64 version, Security_context *sctx)
Creates a new acl map for the authorization id of the security context.
Definition: sql_auth_cache.cc:3432
mysql_mutex_t m_cache_flush_mutex
Definition: sql_auth_cache.h:750
void flush_cache()
Removes all acl map objects with a references count of zero.
Definition: sql_auth_cache.cc:3411
std::atomic< uint64 > m_role_graph_version
Role graph version counter.
Definition: sql_auth_cache.h:748
Acl_cache_internal m_cache
Definition: sql_auth_cache.h:749
Acl_cache()
Definition: sql_auth_cache.cc:3232
Acl_map * checkout_acl_map(Security_context *sctx, Auth_id_ref &uid, List_of_auth_id_refs &active_roles)
Returns a pointer to an acl map to the caller and increase the reference count on the object,...
Definition: sql_auth_cache.cc:3333
void return_acl_map(Acl_map *map)
When the security context is done with the acl map it calls the cache to decrease the reference count...
Definition: sql_auth_cache.cc:3382
Definition: sql_auth_cache.h:225
uint8 m_salt[SCRAMBLE_LENGTH+1]
The salt variable is used as the password hash for native_password_authetication.
Definition: sql_auth_cache.h:239
uint8 m_salt_len
In the old protocol the salt_len indicated what type of autnetication protocol was used: 0 - no passw...
Definition: sql_auth_cache.h:244
LEX_CSTRING m_auth_string
Definition: sql_auth_cache.h:234
Acl_credential()
Definition: sql_auth_cache.h:227
Container for global, schema, table/view and routine ACL maps.
Definition: sql_auth_cache.h:640
Grant_acl_set * grant_acls()
Definition: sql_auth_cache.cc:3307
void increase_reference_count()
Definition: sql_auth_cache.cc:3319
std::atomic< int32 > m_reference_count
Definition: sql_auth_cache.h:670
Dynamic_privileges * dynamic_privileges()
Definition: sql_auth_cache.cc:3313
Restrictions & restrictions()
Definition: sql_auth_cache.cc:3317
Acl_map(Security_context *sctx, uint64 ver)
Definition: sql_auth_cache.cc:3250
Acl_map & operator=(const Acl_map &map)
Definition: sql_auth_cache.cc:3297
void decrease_reference_count()
Definition: sql_auth_cache.cc:3321
Acl_map(const Acl_map &map)=delete
~Acl_map()
Definition: sql_auth_cache.cc:3277
Db_access_map * db_acls()
Definition: sql_auth_cache.cc:3301
SP_access_map m_sp_acls
Definition: sql_auth_cache.h:676
Table_access_map m_table_acls
Definition: sql_auth_cache.h:674
Access_bitmask m_global_acl
Definition: sql_auth_cache.h:675
uint32 reference_count()
Definition: sql_auth_cache.h:667
Db_access_map * db_wild_acls()
Definition: sql_auth_cache.cc:3303
Access_bitmask global_acl()
Definition: sql_auth_cache.cc:3299
Db_access_map m_db_acls
Definition: sql_auth_cache.h:672
uint64 m_version
Definition: sql_auth_cache.h:671
Db_access_map m_db_wild_acls
Definition: sql_auth_cache.h:673
Table_access_map * table_acls()
Definition: sql_auth_cache.cc:3305
SP_access_map * sp_acls()
Definition: sql_auth_cache.cc:3309
Dynamic_privileges m_dynamic_privileges
Definition: sql_auth_cache.h:679
SP_access_map * func_acls()
Definition: sql_auth_cache.cc:3311
Restrictions m_restrictions
Definition: sql_auth_cache.h:680
SP_access_map m_func_acls
Definition: sql_auth_cache.h:677
Grant_acl_set m_with_admin_acls
Definition: sql_auth_cache.h:678
uint64 version()
Definition: sql_auth_cache.h:666
Cache to store the Restrictions of every auth_id.
Definition: sql_auth_cache.h:802
Acl_restrictions(Acl_restrictions &&)=delete
malloc_unordered_map< std::string, Restrictions > m_restrictions_map
Definition: sql_auth_cache.h:819
Acl_restrictions(const Acl_restrictions &)=delete
Acl_restrictions & operator=(Acl_restrictions &&)=delete
void upsert_restrictions(const ACL_USER *acl_user, const Restrictions &restriction)
Update, insert or remove the Restrictions for the ACL_USER.
Definition: sql_auth_cache.cc:3826
Restrictions find_restrictions(const ACL_USER *acl_user) const
Find the Restrictions of the ACL_USER.
Definition: sql_auth_cache.cc:3853
size_t size() const
Definition: sql_auth_cache.cc:3867
void remove_restrictions(const ACL_USER *acl_user)
Remove the Restrictions of the ACL_USER.
Definition: sql_auth_cache.cc:3806
Acl_restrictions & operator=(const Acl_restrictions &)=delete
Acl_restrictions()
Construstor.
Definition: sql_auth_cache.cc:3799
Definition: sql_auth_cache.h:440
Access_bitmask rights
Definition: sql_auth_cache.h:442
GRANT_COLUMN(String &c, Access_bitmask y)
Definition: sql_auth_cache.cc:916
std::string column
Definition: sql_auth_cache.h:443
Definition: sql_auth_cache.h:447
void set_user_details(const char *h, const char *d, const char *u, const char *t, bool is_routine)
Definition: sql_auth_cache.cc:919
std::string hash_key
Definition: sql_auth_cache.h:455
char * tname
Definition: sql_auth_cache.h:452
const char * user
Definition: sql_auth_cache.h:451
Access_bitmask privs
Definition: sql_auth_cache.h:453
ACL_HOST_AND_IP host
Definition: sql_auth_cache.h:449
char * db
Definition: sql_auth_cache.h:450
virtual ~GRANT_NAME()=default
ulong sort
Definition: sql_auth_cache.h:454
GRANT_NAME(const char *h, const char *d, const char *u, const char *t, Access_bitmask p, bool is_routine)
Definition: sql_auth_cache.cc:943
virtual bool ok()
Definition: sql_auth_cache.h:460
Definition: sql_auth_cache.h:465
collation_unordered_multimap< std::string, unique_ptr_destroy_only< GRANT_COLUMN > > hash_columns
Definition: sql_auth_cache.h:470
GRANT_TABLE(const char *h, const char *d, const char *u, const char *t, Access_bitmask p, Access_bitmask c)
Definition: sql_auth_cache.cc:949
bool init(TABLE *col_privs)
Definition: sql_auth_cache.cc:1007
bool ok() override
Definition: sql_auth_cache.h:477
Access_bitmask cols
Definition: sql_auth_cache.h:467
An interface to access information about Multi factor authentication methods.
Definition: sql_mfa.h:49
Malloc_allocator is a C++ STL memory allocator based on my_malloc/my_free.
Definition: malloc_allocator.h:63
A typesafe replacement for DYNAMIC_ARRAY.
Definition: prealloced_array.h:71
Container of all restrictions for a given user.
Definition: partial_revokes.h:155
A set of THD members describing the current authenticated user.
Definition: sql_security_ctx.h:54
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Definition: auth_internal.h:68
Definition: sql_auth_cache.h:433
uint16 length
Definition: sql_auth_cache.h:436
char key[1]
Definition: sql_auth_cache.h:437
Access_bitmask access
Definition: sql_auth_cache.h:435
std::unordered_map, but with my_malloc and collation-aware comparison.
Definition: map_helpers.h:219
std::unordered_multimap, but with my_malloc and collation-aware comparison.
Definition: map_helpers.h:235
std::unordered_map, but with my_malloc, so that you can track the memory used using PSI memory keys.
Definition: map_helpers.h:157
std::unordered_multimap, but with my_malloc, so that you can track the memory used using PSI memory k...
Definition: map_helpers.h:198
const char * p
Definition: ctype-mb.cc:1225
A better implementation of the UNIX ctype(3) library.
int my_strcasecmp(const CHARSET_INFO *cs, const char *s1, const char *s2)
Definition: m_ctype.h:651
size_t my_casedn_str(const CHARSET_INFO *cs, char *str)
Definition: m_ctype.h:732
static auto find_or_nullptr(const Container &container, const Key &key)
Some useful helpers for associative arrays with MySQL-specific semantics.
Definition: map_helpers.h:54
MYSQL_PLUGIN_IMPORT CHARSET_INFO * system_charset_info
Definition: mysqld.cc:1554
const char wild_many
Character constant for wildcard representing zero or more characters (SQL style).
Definition: mf_wcomp.h:43
const char wild_one
Character constant for wildcard representing any one character (SQL style).
Definition: mf_wcomp.h:37
This file follows Google coding style, except for the name MEM_ROOT (which is kept for historical rea...
std::unique_ptr< T, Destroy_only< T > > unique_ptr_destroy_only
std::unique_ptr, but only destroying.
Definition: my_alloc.h:480
Header for compiler-dependent features.
Some integer typedefs for easier portability.
uint8_t uint8
Definition: my_inttypes.h:63
int32_t int32
Definition: my_inttypes.h:66
uint64_t uint64
Definition: my_inttypes.h:69
uint16_t uint16
Definition: my_inttypes.h:65
uint32_t uint32
Definition: my_inttypes.h:67
#define UINT_MAX32
Definition: my_inttypes.h:79
Functions related to handling of plugins and other dynamically loaded libraries.
#define MYSQL_PLUGIN_IMPORT
Definition: my_sharedlib.h:71
Common header for many mysys elements.
Common definition between mysql server & client.
#define SCRAMBLE_LENGTH
Length of random string sent by server on handshake; this is also length of obfuscated password,...
Definition: mysql_com.h:128
ABI for instrumented mutexes.
Time declarations shared between the server and client API: you should not add anything to this heade...
char * user
Definition: mysqladmin.cc:66
const char * host
Definition: mysqladmin.cc:65
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1105
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Tag dispatch for custom Role_properties.
Definition: sql_auth_cache.h:591
BOOST_INSTALL_PROPERTY(vertex, acl_user)
vertex_acl_user_t
Definition: sql_auth_cache.h:592
@ vertex_acl_user
Definition: sql_auth_cache.h:592
const std::string password_lock_time_days("password_lock_time_days")
underkeys of password locking
const std::string failed_login_attempts("failed_login_attempts")
underkeys of password locking
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
size_t size(const char *const c)
Definition: base64.h:46
mode
Definition: file_handle.h:61
std::map< Key, Value, Compare, ut::allocator< std::pair< const Key, Value > > > map
Specialization of map which uses ut_allocator.
Definition: ut0new.h:2894
std::conditional_t< !std::is_array< T >::value, std::unique_ptr< T, detail::Deleter< T > >, std::conditional_t< detail::is_unbounded_array_v< T >, std::unique_ptr< T, detail::Array_deleter< std::remove_extent_t< T > > >, void > > unique_ptr
The following is a common type that is returned by all the ut::make_unique (non-aligned) specializati...
Definition: ut0new.h:2440
PSI_memory_key key_memory_acl_cache
Definition: psi_memory_key.cc:102
required string key
Definition: replication_asynchronous_connection_failover.proto:60
Lex_acl_attrib_udyn
This is generic enum.
Definition: table.h:2651
uint grant_version
Definition: sql_auth_cache.cc:166
std::unique_ptr< malloc_unordered_multimap< std::string, unique_ptr_destroy_only< GRANT_TABLE > > > column_priv_hash
Definition: sql_auth_cache.cc:143
Prealloced_array< ACL_DB, ACL_PREALLOC_SIZE > * acl_dbs
Definition: sql_auth_cache.cc:135
std::unique_ptr< malloc_unordered_multimap< std::string, unique_ptr_destroy_only< GRANT_NAME > > > proc_priv_hash
Definition: sql_auth_cache.cc:146
Acl_user_ptr_list * cached_acl_users_for_name(const char *name)
Fetch the list of ACL_USERs which share name or have no name.
Definition: sql_auth_cache.cc:1152
Acl_cache_allocator< ACL_USER * > Acl_user_ptr_allocator
Definition: sql_auth_cache.h:504
boost::adjacency_list< boost::setS, boost::vecS, boost::bidirectionalS, Role_properties, Role_edge_properties > Granted_roles_graph
A graph of all users/roles privilege inheritance.
Definition: sql_auth_cache.h:614
T * name_hash_search(const malloc_unordered_multimap< std::string, unique_ptr_destroy_only< T > > &name_hash, const char *host, const char *ip, const char *db, const char *user, const char *tname, bool exact, bool name_tolower)
Definition: sql_auth_cache.h:532
Acl_cache_lock_mode
Enum for specifying lock type over Acl cache.
Definition: sql_auth_cache.h:759
MYSQL_PLUGIN_IMPORT CHARSET_INFO * files_charset_info
Definition: mysqld.cc:1554
MEM_ROOT global_acl_memory
Definition: sql_auth_cache.cc:131
Prealloced_array< ACL_USER, ACL_PREALLOC_SIZE > * acl_users
Definition: sql_auth_cache.cc:133
bool allow_all_hosts
Definition: sql_auth_cache.cc:165
boost::property< boost::vertex_acl_user_t, ACL_USER, boost::property< boost::vertex_name_t, std::string > > Role_properties
Custom vertex properties used in Granted_roles_graph TODO ACL_USER contains too much information.
Definition: sql_auth_cache.h:604
boost::graph_traits< Granted_roles_graph >::in_edge_iterator in_edge_itr_t
The type for the iterator returned by in_edges().
Definition: sql_auth_cache.h:637
Acl_cache * get_global_acl_cache()
Definition: sql_auth_cache.cc:109
std::unique_ptr< malloc_unordered_multimap< std::string, unique_ptr_destroy_only< GRANT_NAME > > > func_priv_hash
Definition: sql_auth_cache.h:522
boost::graph_traits< Granted_roles_graph >::out_edge_iterator out_edge_itr_t
The type for the iterator returned by out_edges().
Definition: sql_auth_cache.h:633
std::unique_ptr< Acl_restrictions > acl_restrictions
Definition: sql_auth_cache.cc:150
Prealloced_array< ACL_HOST_AND_IP, ACL_PREALLOC_SIZE > * acl_wild_hosts
Definition: sql_auth_cache.cc:136
void rebuild_cached_acl_users_for_name(void)
Build the lists of ACL_USERs which share name or have no name.
Definition: sql_auth_cache.cc:1102
#define NUM_CREDENTIALS
Definition: sql_auth_cache.h:221
boost::property< boost::edge_capacity_t, int > Role_edge_properties
Definition: sql_auth_cache.h:606
MEM_ROOT memex
Definition: sql_auth_cache.cc:132
boost::graph_traits< Granted_roles_graph >::vertex_descriptor Role_vertex_descriptor
The data type of a vertex in the Granted_roles_graph.
Definition: sql_auth_cache.h:618
boost::graph_traits< Granted_roles_graph >::edge_descriptor Role_edge_descriptor
The data type of an edge in the Granted_roles_graph.
Definition: sql_auth_cache.h:622
GRANT_TABLE * table_hash_search(const char *host, const char *ip, const char *db, const char *user, const char *tname, bool exact)
Definition: sql_auth_cache.h:575
std::list< ACL_USER *, Acl_user_ptr_allocator > Acl_user_ptr_list
Definition: sql_auth_cache.h:505
std::unordered_map< std::string, Role_vertex_descriptor > Role_index_map
The datatype of the map between authids and graph vertex descriptors.
Definition: sql_auth_cache.h:625
boost::graph_traits< Granted_roles_graph >::degree_size_type degree_s_t
The type used for the number of edges incident to a vertex in the graph.
Definition: sql_auth_cache.h:629
GRANT_NAME * routine_hash_search(const char *host, const char *ip, const char *db, const char *user, const char *tname, bool proc, bool exact)
Definition: sql_auth_cache.h:566
collation_unordered_map< std::string, ACL_USER * > * acl_check_hosts
Definition: sql_auth_cache.cc:149
const size_t ACL_PREALLOC_SIZE
Definition: sql_auth_cache.h:512
Prealloced_array< ACL_PROXY_USER, ACL_PREALLOC_SIZE > * acl_proxy_users
Definition: sql_auth_cache.cc:134
GRANT_COLUMN * column_hash_search(GRANT_TABLE *t, const char *cname, size_t length)
Definition: sql_auth_cache.h:583
LF_HASH Acl_cache_internal
Definition: sql_auth_cache.h:683
static MEM_ROOT mem
Definition: sql_servers.cc:100
case opt name
Definition: sslopt-case.h:29
Definition: sql_auth_cache.h:492
Acl_cache_allocator< U > other
Definition: sql_auth_cache.h:493
Definition: m_ctype.h:421
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
Definition: mysql_lex_string.h:40
Definition: mysql_time.h:82
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50
Definition: sql_connect.h:41
SSL_type
Definition: violite.h:307