diff options
author | Jon Olav Hauglid <jon.hauglid@oracle.com> | 2011-04-11 12:55:43 +0200 |
---|---|---|
committer | Jon Olav Hauglid <jon.hauglid@oracle.com> | 2011-04-11 12:55:43 +0200 |
commit | 308694c6592b04a6b517997d3542ed081ba66ff2 (patch) | |
tree | 78c2e2ec436b94ae2ec8c6ab3e3d2da5a5efcdbc /mysql-test | |
parent | d368bf540c48ce5f888220a8d759135645dbae82 (diff) | |
parent | 82d218d61f7d0811a91b0ff154a67b88239f013a (diff) | |
download | mariadb-git-308694c6592b04a6b517997d3542ed081ba66ff2.tar.gz |
Merge from mysql-5.1-security to mysql-5.5-security
Text conflict in mysql-test/r/sp-security.result
Text conflict in mysql-test/t/sp-security.test
Text conflict in sql/sp_head.cc
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/sp-security.result | 30 | ||||
-rw-r--r-- | mysql-test/t/sp-security.test | 40 |
2 files changed, 70 insertions, 0 deletions
diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result index c09579b13eb..7538bfc9f4a 100644 --- a/mysql-test/r/sp-security.result +++ b/mysql-test/r/sp-security.result @@ -592,3 +592,33 @@ ERROR 42000: alter routine command denied to user 'bug57061_user'@'localhost' fo # Connection 'default'. drop user bug57061_user@localhost; drop database mysqltest_db; +# +# Bug#11882603 SELECT_ACL ON ANY COLUMN IN MYSQL.PROC ALLOWS TO SEE +# DEFINITION OF ANY ROUTINE. +# +DROP DATABASE IF EXISTS db1; +CREATE DATABASE db1; +CREATE PROCEDURE db1.p1() SELECT 1; +CREATE USER user2@localhost IDENTIFIED BY ''; +GRANT SELECT(db) ON mysql.proc TO user2@localhost; +# Connection con2 as user2 +# The below statements before disclosed info from body_utf8 column. +SHOW CREATE PROCEDURE db1.p1; +ERROR 42000: PROCEDURE p1 does not exist +SHOW PROCEDURE CODE db1.p1; +ERROR 42000: PROCEDURE p1 does not exist +# Check that SHOW works with SELECT grant on whole table +# Connection default +GRANT SELECT ON mysql.proc TO user2@localhost; +# Connection con2 +# This should work +SHOW CREATE PROCEDURE db1.p1; +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() +SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci +SHOW PROCEDURE CODE db1.p1; +Pos Instruction +0 stmt 0 "SELECT 1" +# Connection default +DROP USER user2@localhost; +DROP DATABASE db1; diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test index d7ea829bf50..716529fa67b 100644 --- a/mysql-test/t/sp-security.test +++ b/mysql-test/t/sp-security.test @@ -959,6 +959,46 @@ drop user bug57061_user@localhost; drop database mysqltest_db; +--echo # +--echo # Bug#11882603 SELECT_ACL ON ANY COLUMN IN MYSQL.PROC ALLOWS TO SEE +--echo # DEFINITION OF ANY ROUTINE. +--echo # + +--disable_warnings +DROP DATABASE IF EXISTS db1; +--enable_warnings + +CREATE DATABASE db1; +CREATE PROCEDURE db1.p1() SELECT 1; +CREATE USER user2@localhost IDENTIFIED BY ''; +GRANT SELECT(db) ON mysql.proc TO user2@localhost; + +--echo # Connection con2 as user2 +connect (con2, localhost, user2); +--echo # The below statements before disclosed info from body_utf8 column. +--error ER_SP_DOES_NOT_EXIST +SHOW CREATE PROCEDURE db1.p1; +--error ER_SP_DOES_NOT_EXIST +SHOW PROCEDURE CODE db1.p1; + +--echo # Check that SHOW works with SELECT grant on whole table +--echo # Connection default +connection default; +GRANT SELECT ON mysql.proc TO user2@localhost; + +--echo # Connection con2 +connection con2; +--echo # This should work +SHOW CREATE PROCEDURE db1.p1; +SHOW PROCEDURE CODE db1.p1; + +--echo # Connection default +connection default; +disconnect con2; +DROP USER user2@localhost; +DROP DATABASE db1; + + # Wait till all disconnects are completed --source include/wait_until_count_sessions.inc |