mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge
This commit is contained in:
@ -4579,6 +4579,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
|
||||
{
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
ulong db_access;
|
||||
bool db_is_pattern= test(want_access & GRANT_ACL);
|
||||
#endif
|
||||
ulong dummy;
|
||||
DBUG_ENTER("check_access");
|
||||
@ -4610,9 +4611,8 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
|
||||
*/
|
||||
db_access= thd->db_access;
|
||||
if (!(thd->master_access & SELECT_ACL) &&
|
||||
(db && (!thd->db || strcmp(db,thd->db))))
|
||||
db_access=acl_get(thd->host, thd->ip,
|
||||
thd->priv_user, db, test(want_access & GRANT_ACL));
|
||||
(db && (!thd->db || db_is_pattern || strcmp(db,thd->db))))
|
||||
db_access=acl_get(thd->host, thd->ip, thd->priv_user, db, db_is_pattern);
|
||||
*save_priv=thd->master_access | db_access;
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
@ -4633,9 +4633,8 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
|
||||
if (db == any_db)
|
||||
DBUG_RETURN(FALSE); // Allow select on anything
|
||||
|
||||
if (db && (!thd->db || strcmp(db,thd->db)))
|
||||
db_access=acl_get(thd->host, thd->ip,
|
||||
thd->priv_user, db, test(want_access & GRANT_ACL));
|
||||
if (db && (!thd->db || db_is_pattern || strcmp(db,thd->db)))
|
||||
db_access=acl_get(thd->host, thd->ip, thd->priv_user, db, db_is_pattern);
|
||||
else
|
||||
db_access=thd->db_access;
|
||||
DBUG_PRINT("info",("db_access: %lu", db_access));
|
||||
|
Reference in New Issue
Block a user