diff options
author | Evgeny Potemkin <epotemkin@mysql.com> | 2008-09-05 14:44:16 +0400 |
---|---|---|
committer | Evgeny Potemkin <epotemkin@mysql.com> | 2008-09-05 14:44:16 +0400 |
commit | aa74a314e482e801b8a893126989ba53d5c37477 (patch) | |
tree | 37e191b95078e35cca1e041024aee31928a7fc58 /mysql-test/t/status.test | |
parent | 565c4d2bb2eee5dd574f29c6d309a78c567da9c2 (diff) | |
download | mariadb-git-aa74a314e482e801b8a893126989ba53d5c37477.tar.gz |
Bug#37908: Skipped access right check caused server crash.
The check_table_access function initializes per-table grant info and performs
access rights check. It wasn't called for SHOW STATUS statement thus left
grants info uninitialized. In some cases this led to server crash. In other
cases it allowed a user to check for presence/absence of arbitrary values in
any tables.
Now the check_table_access function is called prior to the statement
processing.
Diffstat (limited to 'mysql-test/t/status.test')
-rw-r--r-- | mysql-test/t/status.test | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test index bc629e9c86d..8bd9ee26b26 100644 --- a/mysql-test/t/status.test +++ b/mysql-test/t/status.test @@ -261,4 +261,37 @@ drop function f1; show status like 'Com%function'; +# +# Bug#37908: Skipped access right check caused server crash. +# +connect (root, localhost, root,,test); +connection root; +--disable_warnings +create database db37908; +--enable_warnings +create table db37908.t1(f1 int); +insert into db37908.t1 values(1); +grant usage,execute on test.* to mysqltest_1@localhost; +delimiter |; +create procedure proc37908() begin select 1; end | +create function func37908() returns int sql security invoker + return (select * from db37908.t1 limit 1)| +delimiter ;| + +connect (user1,localhost,mysqltest_1,,test); +connection user1; + +--error 1142 +select * from db37908.t1; +--error 1142 +show status where variable_name ='uptime' and 2 in (select * from db37908.t1); +--error 1142 +show procedure status where name ='proc37908' and 1 in (select f1 from db37908.t1); +--error 1142 +show function status where name ='func37908' and 1 in (select func37908()); + +connection root; +drop database db37908; +drop procedure proc37908; +drop function func37908; # End of 5.1 tests |