diff options
author | unknown <gkodinov@mysql.com> | 2006-05-26 11:57:56 +0300 |
---|---|---|
committer | unknown <gkodinov@mysql.com> | 2006-05-26 11:57:56 +0300 |
commit | dd01932a76e119a8f5b7fedd2fa4aa8c6d13b453 (patch) | |
tree | 85cd496f0198f594fac3a813ad6f0c4e96fca855 /sql/sql_acl.cc | |
parent | 232a7e7c9f6e78e9cf2268b9bd635ac452cc9946 (diff) | |
parent | 6386c5dfc089aa4da506201ce517a5d1340f2926 (diff) | |
download | mariadb-git-dd01932a76e119a8f5b7fedd2fa4aa8c6d13b453.tar.gz |
Merge mysql.com:/home/kgeorge/mysql/5.0/clean
into mysql.com:/home/kgeorge/mysql/5.0/B18681
sql/sql_acl.cc:
Auto merged
sql/table.cc:
Auto merged
mysql-test/r/view_grant.result:
resolved conflict
mysql-test/t/view_grant.test:
resolved merge conflict
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 197c703ece3..46b1b8795b6 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -3564,6 +3564,7 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables, TABLE_LIST *table, *first_not_own_table= thd->lex->first_not_own_table(); Security_context *sctx= thd->security_ctx; uint i; + ulong orig_want_access= want_access; DBUG_ENTER("check_grant"); DBUG_ASSERT(number > 0); @@ -3585,18 +3586,22 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables, table->grant.orig_want_privilege= (want_access & ~SHOW_VIEW_ACL); } - want_access&= ~sctx->master_access; - if (!want_access) - DBUG_RETURN(0); // ok - rw_rdlock(&LOCK_grant); for (table= tables; table && number-- && table != first_not_own_table; table= table->next_global) { GRANT_TABLE *grant_table; + sctx = test(table->security_ctx) ? + table->security_ctx : thd->security_ctx; + + want_access= orig_want_access; + want_access&= ~sctx->master_access; + if (!want_access) + continue; // ok + if (!(~table->grant.privilege & want_access) || - table->derived || table->schema_table || table->belong_to_view) + table->derived || table->schema_table) { /* It is subquery in the FROM clause. VIEW set table->derived after |