Lines 2704-2709
Link Here
|
2704 |
DBUG_PRINT("enter",("want_access: %lu master_access: %lu", want_access, |
2704 |
DBUG_PRINT("enter",("want_access: %lu master_access: %lu", want_access, |
2705 |
thd->master_access)); |
2705 |
thd->master_access)); |
2706 |
ulong db_access,dummy; |
2706 |
ulong db_access,dummy; |
|
|
2707 |
bool db_is_pattern= test(want_access & GRANT_ACL); |
2707 |
if (save_priv) |
2708 |
if (save_priv) |
2708 |
*save_priv=0; |
2709 |
*save_priv=0; |
2709 |
else |
2710 |
else |
Lines 2725-2733
Link Here
|
2725 |
*/ |
2726 |
*/ |
2726 |
db_access= thd->db_access; |
2727 |
db_access= thd->db_access; |
2727 |
if (!(thd->master_access & SELECT_ACL) && |
2728 |
if (!(thd->master_access & SELECT_ACL) && |
2728 |
(db && (!thd->db || strcmp(db,thd->db)))) |
2729 |
(db && (!thd->db || db_is_pattern || strcmp(db,thd->db)))) |
2729 |
db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr, |
2730 |
db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr, |
2730 |
thd->priv_user, db, 0); /* purecov: inspected */ |
2731 |
thd->priv_user, db, db_is_pattern); |
2731 |
*save_priv=thd->master_access | db_access; |
2732 |
*save_priv=thd->master_access | db_access; |
2732 |
DBUG_RETURN(FALSE); |
2733 |
DBUG_RETURN(FALSE); |
2733 |
} |
2734 |
} |
Lines 2745-2753
Link Here
|
2745 |
if (db == any_db) |
2746 |
if (db == any_db) |
2746 |
DBUG_RETURN(FALSE); // Allow select on anything |
2747 |
DBUG_RETURN(FALSE); // Allow select on anything |
2747 |
|
2748 |
|
2748 |
if (db && (!thd->db || strcmp(db,thd->db))) |
2749 |
if (db && (!thd->db || db_is_pattern || strcmp(db,thd->db))) |
2749 |
db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr, |
2750 |
db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr, |
2750 |
thd->priv_user, db, 0); /* purecov: inspected */ |
2751 |
thd->priv_user, db, db_is_pattern); |
2751 |
else |
2752 |
else |
2752 |
db_access=thd->db_access; |
2753 |
db_access=thd->db_access; |
2753 |
// Remove SHOW attribute and access rights we already have |
2754 |
// Remove SHOW attribute and access rights we already have |