mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-18328: Make DISKS plugin check some privilege to access information_schema.DISKS table
Check FILE privelege.
This commit is contained in:
15
plugin/disks/mysql-test/disks/disks_notembedded.result
Normal file
15
plugin/disks/mysql-test/disks/disks_notembedded.result
Normal file
@ -0,0 +1,15 @@
|
||||
#
|
||||
# MDEV-18328: Make DISKS plugin check some privilege to access
|
||||
# information_schema.DISKS table
|
||||
#
|
||||
CREATE USER user1@localhost;
|
||||
GRANT SELECT ON *.* TO user1@localhost;
|
||||
select sum(Total) > sum(Available), sum(Total)>sum(Used) from information_schema.disks;
|
||||
sum(Total) > sum(Available) sum(Total)>sum(Used)
|
||||
NULL NULL
|
||||
GRANT FILE ON *.* TO user1@localhost;
|
||||
select sum(Total) > sum(Available), sum(Total)>sum(Used) from information_schema.disks;
|
||||
sum(Total) > sum(Available) sum(Total)>sum(Used)
|
||||
1 1
|
||||
DROP USER user1@localhost;
|
||||
# End of 10.1 tests
|
25
plugin/disks/mysql-test/disks/disks_notembedded.test
Normal file
25
plugin/disks/mysql-test/disks/disks_notembedded.test
Normal file
@ -0,0 +1,25 @@
|
||||
source include/not_embedded.inc;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-18328: Make DISKS plugin check some privilege to access
|
||||
--echo # information_schema.DISKS table
|
||||
--echo #
|
||||
|
||||
CREATE USER user1@localhost;
|
||||
GRANT SELECT ON *.* TO user1@localhost;
|
||||
|
||||
connect (con1,localhost,user1,,);
|
||||
connection con1;
|
||||
select sum(Total) > sum(Available), sum(Total)>sum(Used) from information_schema.disks;
|
||||
disconnect con1;
|
||||
|
||||
connection default;
|
||||
GRANT FILE ON *.* TO user1@localhost;
|
||||
|
||||
connect (con1,localhost,user1,,);
|
||||
connection con1;
|
||||
select sum(Total) > sum(Available), sum(Total)>sum(Used) from information_schema.disks;
|
||||
connection default;
|
||||
DROP USER user1@localhost;
|
||||
|
||||
--echo # End of 10.1 tests
|
Reference in New Issue
Block a user