diff options
author | unknown <serg@serg.mylan> | 2005-03-30 10:52:28 +0200 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2005-03-30 10:52:28 +0200 |
commit | fc7b19d480633a16228e1afea9018c38d26b40bc (patch) | |
tree | 1e08bb559b4d3458b6188681e1e1a24e19e75a3d /sql | |
parent | 3e2f7ed4f5e7d1611a074fac306419cfb4ad0cf4 (diff) | |
parent | fe811dd892f2301f6787033f16e84c3a4412eab2 (diff) | |
download | mariadb-git-fc7b19d480633a16228e1afea9018c38d26b40bc.tar.gz |
merged
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_parse.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index b699577d5e4..51ad2db3527 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3731,6 +3731,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, db ? db : "", want_access, thd->master_access)); #ifndef NO_EMBEDDED_ACCESS_CHECKS ulong db_access; + bool db_is_pattern= test(want_access & GRANT_ACL); #endif ulong dummy; if (save_priv) @@ -3757,9 +3758,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); } @@ -3777,9 +3777,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)); |