mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Bug58747 57359 patch: breaks secure_file_priv+not secure yet+still accesses other folders
"load data infile .." allowed for access to unautohorized tables. Due to a faulty if-statement it was possible to circumvent the secure_file_priv restriction. mysql-test/mysql-test-run.pl: * Add SECURE_LOAD_PATH environment variable to mtr test cases. mysql-test/suite/sys_vars/r/secure_file_priv2.result: * add test for bug58747 mysql-test/suite/sys_vars/t/secure_file_priv2-master.opt: * add test for bug58747 mysql-test/suite/sys_vars/t/secure_file_priv2.test: * add test for bug58747 sql/sql_load.cc: * Correct faulty if-statement * fix indentation * move my_stat() block to after is_secure_file_path() check.
This commit is contained in:
6
mysql-test/suite/sys_vars/r/secure_file_priv2.result
Normal file
6
mysql-test/suite/sys_vars/r/secure_file_priv2.result
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE TABLE t1 (c1 INT);
|
||||
LOAD DATA INFILE "t1.MYI" into table t1;
|
||||
ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
|
||||
LOAD DATA INFILE "/test" into table t1;
|
||||
ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
|
||||
DROP TABLE t1;
|
1
mysql-test/suite/sys_vars/t/secure_file_priv2-master.opt
Normal file
1
mysql-test/suite/sys_vars/t/secure_file_priv2-master.opt
Normal file
@ -0,0 +1 @@
|
||||
--secure_file_priv=$SECURE_LOAD_PATH
|
23
mysql-test/suite/sys_vars/t/secure_file_priv2.test
Normal file
23
mysql-test/suite/sys_vars/t/secure_file_priv2.test
Normal file
@ -0,0 +1,23 @@
|
||||
#
|
||||
# Bug58747 breaks secure_file_priv+not secure yet+still accesses other folders
|
||||
#
|
||||
CREATE TABLE t1 (c1 INT);
|
||||
#
|
||||
# Before the patch this statement failed with
|
||||
# Linux:
|
||||
# -> errno 13: 'Can't get stat of '
|
||||
# Windows:
|
||||
# -> Warning 1366 Incorrect integer value: '■■☺' for
|
||||
# -> column 'c1' at row 1
|
||||
# Now it should consistently fail with ER_OPTION_PREVENTS_STATEMENT
|
||||
# on all platforms.
|
||||
--error ER_OPTION_PREVENTS_STATEMENT
|
||||
LOAD DATA INFILE "t1.MYI" into table t1;
|
||||
|
||||
#
|
||||
# The following test makes the assuption that /test isn't a valid path in any
|
||||
# operating system running the test suite.
|
||||
--error ER_OPTION_PREVENTS_STATEMENT
|
||||
LOAD DATA INFILE "/test" into table t1;
|
||||
|
||||
DROP TABLE t1;
|
Reference in New Issue
Block a user