Commit graph

70 commits

Author SHA1 Message Date
Sergey Vojtovich
4050910f03 BUG#40980 - Drop table can remove another MyISAM table's
data and index files

It was possible if DATA/INDEX DIRECTORY is pointing to
symlinked MySQL data home directory.

Do not allow to drop data/index files implicitly symlinked
to data home directory. For such tables remove symlink only.
2010-04-01 18:49:02 +04:00
Alfranio Correia
3175a06a13 merge 5.1 --> 5.1-rpl 2008-12-13 19:42:12 +00:00
Ingo Struewing
6673b2849a Bug#41002 - symlink.test fails on symlinked datadir
symlink.test failed when run in an environment that has mysql-test/var
symlinked to elsewhere, e.g. a memory file system. This is the case
when running mysql-test-run --mem.

In this case the server does not detect that the directory specified
with a DATA/INDEX DIRECTORY clause is within its data home directory.
This problem was reported as Bug#39277 (Creation of table with data
and/or index files in data home directory succeeds). It was decided
that it will not be fixed in 5.1. Hence, the current behavior is
accepted for 5.1. It will be fixed in 6.0 though.

Fixed the test case so that it works in both environments. 1. When no
symbolic link is involved, the server notices that the data/index
directory is in its data hone directory and rejects the CREATE/ALTER
TABLE statement. 2. When the data home directory is symlinked, it
does not notice the problem and executes the statement sucessfully.
2008-11-25 15:06:31 +01:00
Mats Kindahl
1f29c52581 Merging 5.1 main into 5.1-rpl 2008-10-23 21:27:09 +02:00
Patrick Crews
99abc81c5f Merge 5.0 -> 5.1 2008-09-30 15:32:35 -04:00
Patrick Crews
51c40c5bd0 Bug#38311 - Fix of some cruft from remove_files in ndb_autodiscover.test, clean up of distinct.test,
and replacing error numbers with error names.
2008-09-23 05:24:32 -04:00
Patrick Crews
2a419a5627 Bug#38311 Some tests use 'rm' which is not portable
Substituted use of MTR's remove_file function in the tests
Started with 5.0 tree and will clean up any offenders discovered during upmerge.
2008-09-20 02:21:28 -04:00
He Zhenxing
6e86e05823 Merge 5.1 main -> 5.1-rpl 2008-09-06 08:51:17 +08:00
Alexey Botchkov
ab1ce67eb0 merging fix 2008-08-26 14:50:32 +05:00
Alexey Botchkov
d7445d0493 merging fixes 2008-08-26 14:21:07 +05:00
Alexey Botchkov
871201db3d merging 2008-08-23 07:47:43 +05:00
Alexey Botchkov
69657f972b Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
test_if_data_home_dir fixed to look into real path.
            Checks added to mi_open for symlinks into data home directory.

per-file messages:
        include/my_sys.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          my_is_symlink interface added
        include/myisam.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          myisam_test_invalid_symlink interface added
        myisam/mi_check.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          mi_open_datafile calls modified
        myisam/mi_open.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          code added to mi_open to check for symlinks into data home directory.
          mi_open_datafile now accepts 'original' file path to check if it's
          an allowed symlink.
        myisam/mi_static.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          myisam_test_invlaid_symlink defined
        myisam/myisamchk.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          mi_open_datafile call modified
        myisam/myisamdef.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          mi_open_datafile interface modified - 'real_path' parameter added
        mysql-test/r/symlink.test
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          error codes corrected as some patch now rejected pointing inside datahome
        mysql-test/r/symlink.result
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          error messages corrected in the result
        mysys/my_symlink.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          my_is_symlink() implementsd
          my_realpath() now returns the 'realpath' even if a file isn't a symlink
        sql/mysql_priv.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          test_if_data_home_dir interface
        sql/mysqld.cc
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          myisam_test_invalid_symlik set with the 'test_if_data_home_dir'
        sql/sql_parse.cc
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          error messages corrected
          test_if_data_home_dir code fixed
2008-08-22 17:31:53 +05:00
msvensson@pilot.mysql.com
95d9608d3e Fix paths in test and result files 2008-04-03 21:40:10 +02:00
istruewing@stella.local
8c0300dae9 Merge stella.local:/home2/mydev/mysql-5.1-ateam
into  stella.local:/home2/mydev/mysql-5.1-axmrg
2008-03-20 12:22:02 +01:00
mattiasj@witty.
d733351148 Bug#35305: partition_symlink test failures
Updated the test due to bug 32167

Corrected spelling of error message
2008-03-17 16:11:26 +01:00
antony@pcg5ppc.xiphis.org
91e44529bd Merge pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/mysql-5.1
into  pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/merge.20080307/mysql-5.1
2008-03-14 11:13:54 -07:00
istruewing@stella.local
ed89b81b3f Post-merge fix. Moved the symlink handling from sql_parse.cc here. 2008-03-14 14:03:47 +01:00
istruewing@stella.local
eabe082d6f Manual merge 2008-03-14 12:02:11 +01:00
gluh@mysql.com/mgluh.(none)
fc1ae07785 test case fix 2008-03-03 15:02:34 +04:00
gluh@mysql.com/eagle.(none)
2f5abfd3ef fixed problem with embedded server 2008-02-29 17:58:35 +04:00
gluh@eagle.(none)
1616c68bde Merge mysql.com:/home/gluh/MySQL/Merge/4.1-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
2008-02-29 16:58:20 +04:00
gluh@mysql.com/eagle.(none)
4d582db8ea test fix 2008-02-29 16:56:41 +04:00
gluh@mysql.com/eagle.(none)
931bdedbc2 after merge fix 2008-02-29 15:04:00 +04:00
gluh@eagle.(none)
df5fbf5ae0 Merge mysql.com:/home/gluh/MySQL/Merge/4.1-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
2008-02-29 14:05:38 +04:00
gluh@mysql.com/eagle.(none)
13bb7e0a22 Bug#32167 another privilege bypass with DATA/INDEX DIRECORY(ver 4.1,5.0)
added new function test_if_data_home_dir() which checks that
path does not contain mysql data home directory.
Using of mysql data home directory in
DATA DIRECTORY & INDEX DIRECTORY is disallowed.
2008-02-29 13:55:00 +04:00
gluh@mysql.com/eagle.(none)
9d42a09675 Bug#32167 another privilege bypass with DATA/INDEX DIRECORY(3rd version for 5.1)
added new function test_if_data_home_dir() which checks that
path does not contain mysql data home directory.
Using of 'mysql data home'/'any db name' in
DATA DIRECTORY & INDEX DIRECTORY is disallowed
2008-02-28 16:46:52 +04:00
svoj@mysql.com/june.mysql.com
1d0ea2d043 BUG#25677 - With --skip-symbolic-links option on, DATA DIRECTORY
clause is silently ignored

When symbolic links are disabled by command line option or
NO_DIR_IN_CREATE sql mode, CREATE TABLE silently ignores
DATA/INDEX DIRECTORY options.

With this fix a warning is issued when symbolic links are disabled.
2007-12-07 17:40:42 +04:00
svoj@june.mysql.com
d03491e8f9 Merge mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-5.0-engines
into  mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-5.1-engines
2007-11-12 21:55:53 +04:00
svoj@june.mysql.com
9799d6c479 Merge mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-5.0-engines
2007-11-12 21:54:04 +04:00
svoj@mysql.com/june.mysql.com
ed8f506d29 symlink.test, symlink.result:
Use proper variable for test.
2007-11-12 21:52:30 +04:00
svoj@june.mysql.com
162d70cb02 Merge mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-5.0-engines
into  mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-5.1-engines
2007-11-12 15:26:37 +04:00
svoj@june.mysql.com
5e44309422 Merge mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-5.0-engines
2007-11-12 15:16:00 +04:00
svoj@mysql.com/june.mysql.com
a6def1f4ab Merge mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-4.0
into  mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-4.1-engines
2007-11-12 15:02:42 +04:00
svoj@mysql.com/june.mysql.com
d06e2f9223 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.
2007-11-06 18:09:33 +04:00
gshchepa/uchum@gleb.loc
b434254e0e symlink.test, symlink.result:
Minor fix for test case of bug #29325 to make emb test happy.
2007-07-14 01:34:46 +05:00
gshchepa/uchum@gleb.loc
1674d8dc35 Merge gleb.loc:/home/uchum/work/bk/5.0-opt
into  gleb.loc:/home/uchum/work/bk/5.1-opt
2007-07-13 19:36:10 +05:00
gkodinov/kgeorge@magare.gmz
d6ad4e6eb9 disabled the output of the full path in tesing bug 29325 2007-07-13 16:32:29 +03:00
gkodinov/kgeorge@magare.gmz
2b8e462637 Bug 29325: moved the test from create_not_windows to symlink. 2007-07-13 13:56:22 +03:00
tsmith@quadxeon.mysql.com
43b4b044f7 Fix for valgrind errors in test: require symlink support for partition_not_windows.test 2007-04-25 20:21:55 +02:00
gluh@mysql.com/eagle.(none)
010dc0b55c Valgrind error fixes
Notes:
This patch doesn't fix all issues in the tree and we need jani's fix for that
This patch shoud not be merged into 5.0
2007-02-01 18:00:24 +04:00
msvensson@maint1.mysql.com
6cd4a816bc Use MYSQLTEST_VARDIR variable 2006-12-18 10:22:48 +01:00
tsmith/tim@siva.hindu.god
9cbe0621b8 Merge siva.hindu.god:/usr/home/tim/m/bk/41
into  siva.hindu.god:/usr/home/tim/m/bk/50
2006-12-14 16:51:12 -07:00
tsmith/tim@siva.hindu.god
8e5be1ad97 myisam.result: a test was moved from the .test file, but the results were not updated. 2006-12-14 16:23:54 -07:00
thek@kpdesk.mysql.com
c9622dfb0a Merge kpdesk.mysql.com:/home/thek/dev/bug17489/my41-bug17498
into  kpdesk.mysql.com:/home/thek/dev/bug17489/my50-bug17498
2006-12-14 13:38:09 +01:00
thek@kpdesk.mysql.com
29f72a0ba1 Bug#17498 failed to put data file in custom directory use "data directory" option
- When this bug was corrected it changed the behavior 
  for data/index directory in the myisam test case.
- This patch moves the OS depending tests to a non-windows
  test file.
2006-12-14 13:23:31 +01:00
msvensson@neptunus.(none)
3d5f530caa Merge neptunus.(none):/home/msvensson/mysql/mysqltest_var/my50-mysqltest_var
into  neptunus.(none):/home/msvensson/mysql/mysqltest_var/my50-mysqltest_var-integration
2006-01-24 08:43:34 +01:00
msvensson@neptunus.(none)
09ec2919a1 Make it possible to run mysql-test-run.pl with default test suite in different vardir. 2006-01-24 08:30:54 +01:00
kent@mysql.com
8fd7e5f922 Merge mysql.com:/Users/kent/mysql/bk/mysql-4.1
into mysql.com:/Users/kent/mysql/bk/mysql-5.0-release
2005-12-08 16:15:27 +01:00
kent@mysql.com
e8198e799e mysqld.cc:
Bug#14960, reverted code to make symdir work on Windows
symlink.test:
  Disabled test case on Windows
2005-12-08 16:13:53 +01:00
monty@mysql.com
15d48525af Merge mysql.com:/home/my/mysql-4.1
into  mysql.com:/home/my/mysql-5.0
2005-07-28 17:09:54 +03:00