Commit 64af2849 authored by serg@serg.mylan's avatar serg@serg.mylan

Merge bk-internal:/home/bk/mysql-4.0/

into serg.mylan:/usr/home/serg/Abk/mysql-4.0
parents bb713b13 2a297353
...@@ -2704,6 +2704,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, ...@@ -2704,6 +2704,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
DBUG_PRINT("enter",("want_access: %lu master_access: %lu", want_access, DBUG_PRINT("enter",("want_access: %lu master_access: %lu", want_access,
thd->master_access)); thd->master_access));
ulong db_access,dummy; ulong db_access,dummy;
bool db_is_pattern= test(want_access & GRANT_ACL);
if (save_priv) if (save_priv)
*save_priv=0; *save_priv=0;
else else
...@@ -2725,9 +2726,9 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, ...@@ -2725,9 +2726,9 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
*/ */
db_access= thd->db_access; db_access= thd->db_access;
if (!(thd->master_access & SELECT_ACL) && if (!(thd->master_access & SELECT_ACL) &&
(db && (!thd->db || strcmp(db,thd->db)))) (db && (!thd->db || db_is_pattern || strcmp(db,thd->db))))
db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr, db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr,
thd->priv_user, db, test(want_access & GRANT_ACL)); thd->priv_user, db, db_is_pattern);
*save_priv=thd->master_access | db_access; *save_priv=thd->master_access | db_access;
DBUG_RETURN(FALSE); DBUG_RETURN(FALSE);
} }
...@@ -2745,9 +2746,9 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, ...@@ -2745,9 +2746,9 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
if (db == any_db) if (db == any_db)
DBUG_RETURN(FALSE); // Allow select on anything DBUG_RETURN(FALSE); // Allow select on anything
if (db && (!thd->db || strcmp(db,thd->db))) if (db && (!thd->db || db_is_pattern || strcmp(db,thd->db)))
db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr, db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr,
thd->priv_user, db, test(want_access & GRANT_ACL)); thd->priv_user, db, db_is_pattern);
else else
db_access=thd->db_access; db_access=thd->db_access;
// Remove SHOW attribute and access rights we already have // Remove SHOW attribute and access rights we already have
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment