mirror of
https://github.com/MariaDB/server.git
synced 2025-11-10 23:02:54 +03:00
Added missing cleanup in sp-security.test. mysql-test/r/sp-security.result: Added clean-up. mysql-test/t/sp-security.test: Added clean-up. sql/item_func.cc: Forgot to wrap things in #ifndef NO_EMBEDDED_ACCESS_CHECKS for the embedded server. sql/sp_head.cc: Forgot to wrap things in #ifndef NO_EMBEDDED_ACCESS_CHECKS for the embedded server. sql/sp_head.h: Forgot to wrap things in #ifndef NO_EMBEDDED_ACCESS_CHECKS for the embedded server. sql/sql_parse.cc: Forgot to wrap things in #ifndef NO_EMBEDDED_ACCESS_CHECKS for the embedded server.
46 lines
1.4 KiB
Plaintext
46 lines
1.4 KiB
Plaintext
use test;
|
|
grant usage on *.* to dummy@localhost;
|
|
drop database if exists db1_secret;
|
|
create database db1_secret;
|
|
use db1_secret;
|
|
create table t1 ( u varchar(64), i int );
|
|
create procedure stamp(i int)
|
|
insert into db1_secret.t1 values (user(), i);
|
|
show procedure status like 'stamp';
|
|
Name Type Definer Modified Created Security_type Comment
|
|
stamp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
|
|
call stamp(1);
|
|
select * from t1;
|
|
u i
|
|
root@localhost 1
|
|
call stamp(2);
|
|
select * from db1_secret.t1;
|
|
ERROR 42000: Access denied for user: 'dummy'@'localhost' to database 'db1_secret'
|
|
call stamp(3);
|
|
select * from db1_secret.t1;
|
|
ERROR 42000: Access denied for user: ''@'localhost' to database 'db1_secret'
|
|
select * from t1;
|
|
u i
|
|
root@localhost 1
|
|
dummy@localhost 2
|
|
anon@localhost 3
|
|
alter procedure stamp sql security invoker;
|
|
show procedure status like 'stamp';
|
|
Name Type Definer Modified Created Security_type Comment
|
|
stamp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 INVOKER
|
|
call stamp(4);
|
|
select * from t1;
|
|
u i
|
|
root@localhost 1
|
|
dummy@localhost 2
|
|
anon@localhost 3
|
|
root@localhost 4
|
|
call stamp(5);
|
|
ERROR 42000: Access denied for user: 'dummy'@'localhost' to database 'db1_secret'
|
|
call stamp(6);
|
|
ERROR 42000: Access denied for user: ''@'localhost' to database 'db1_secret'
|
|
drop procedure stamp;
|
|
use test;
|
|
drop database db1_secret;
|
|
delete from mysql.user where user='dummy';
|