summaryrefslogtreecommitdiff
path: root/mysql-test/t/symlink.test
diff options
context:
space:
mode:
authorunknown <svoj@mysql.com/june.mysql.com>2007-11-06 18:09:33 +0400
committerunknown <svoj@mysql.com/june.mysql.com>2007-11-06 18:09:33 +0400
commitff4b438be005a3cffb5100db93e10da0f7980922 (patch)
tree5f5c06038a6e7b16dd4b68129841b6f35fa87527 /mysql-test/t/symlink.test
parenta7e5f73abb9da35a1c199b89df84596cffe59901 (diff)
downloadmariadb-git-ff4b438be005a3cffb5100db93e10da0f7980922.tar.gz
BUG#32111 - Security Breach via DATA/INDEX DIRECORY and RENAME TABLE
RENAME TABLE against a table with DATA/INDEX DIRECTORY overwrites the file to which the symlink points. This is security issue, because it is possible to create a table with some name in some non-system database and set DATA/INDEX DIRECTORY to mysql system database. Renaming this table to one of mysql system tables (e.g. user, host) would overwrite the system table. Return an error when the file to which the symlink points exist. mysql-test/r/symlink.result: A test case for BUG#32111. mysql-test/t/symlink.test: A test case for BUG#32111. mysys/my_symlink2.c: Return an error when the file to which the symlink points exist.
Diffstat (limited to 'mysql-test/t/symlink.test')
-rw-r--r--mysql-test/t/symlink.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test
index 7a42a60054e..9750e6fdfdd 100644
--- a/mysql-test/t/symlink.test
+++ b/mysql-test/t/symlink.test
@@ -112,3 +112,15 @@ eval alter table t1 index directory="$MYSQL_TEST_DIR/var/log";
enable_query_log;
show create table t1;
drop table t1;
+
+#
+# BUG#32111 - Security Breach via DATA/INDEX DIRECORY and RENAME TABLE
+#
+--replace_result $MYSQL_TEST_DIR TEST_DIR
+eval CREATE TABLE t1(a INT)
+DATA DIRECTORY='$MYSQL_TEST_DIR/var/master-data/mysql'
+INDEX DIRECTORY='$MYSQL_TEST_DIR/var/master-data/mysql';
+--replace_result $MYSQL_TEST_DIR TEST_DIR
+--error 1
+RENAME TABLE t1 TO user;
+DROP TABLE t1;