mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge
This commit is contained in:
@ -1097,6 +1097,9 @@ static void acl_insert_db(const char *user, const char *host, const char *db,
|
||||
|
||||
/*
|
||||
Get privilege for a host, user and db combination
|
||||
|
||||
as db_is_pattern changes the semantics of comparison,
|
||||
acl_cache is not used if db_is_pattern is set.
|
||||
*/
|
||||
|
||||
ulong acl_get(const char *host, const char *ip,
|
||||
@ -1116,7 +1119,7 @@ ulong acl_get(const char *host, const char *ip,
|
||||
db=tmp_db;
|
||||
}
|
||||
key_length=(uint) (end-key);
|
||||
if ((entry=(acl_entry*) acl_cache->search(key,key_length)))
|
||||
if (!db_is_pattern && (entry=(acl_entry*) acl_cache->search(key,key_length)))
|
||||
{
|
||||
db_access=entry->access;
|
||||
VOID(pthread_mutex_unlock(&acl_cache->lock));
|
||||
@ -1165,7 +1168,8 @@ ulong acl_get(const char *host, const char *ip,
|
||||
}
|
||||
exit:
|
||||
/* Save entry in cache for quick retrieval */
|
||||
if ((entry= (acl_entry*) malloc(sizeof(acl_entry)+key_length)))
|
||||
if (!db_is_pattern &&
|
||||
(entry= (acl_entry*) malloc(sizeof(acl_entry)+key_length)))
|
||||
{
|
||||
entry->access=(db_access & host_access);
|
||||
entry->length=key_length;
|
||||
|
Reference in New Issue
Block a user