diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-02-20 22:40:47 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-02-27 12:35:10 +0100 |
commit | d72dbb41229ceb6434ecd3e23d559bb7b39dd15f (patch) | |
tree | fab72e0fca0e0b1d8d29ebfa13b6c21c5df10430 /mysys | |
parent | 955f2f036d6252b90e2bffcec521dd4a7db0a30a (diff) | |
download | mariadb-git-d72dbb41229ceb6434ecd3e23d559bb7b39dd15f.tar.gz |
bugfix: remove my_delete_with_symlink()
it was race condition prone. instead use either a pair of my_delete()
calls with already resolved paths, or a safe high-level function
my_handler_delete_with_symlink(), like MyISAM and Aria already do.
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/my_symlink2.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/mysys/my_symlink2.c b/mysys/my_symlink2.c index 66b823aeafe..5fe7b8fcae9 100644 --- a/mysys/my_symlink2.c +++ b/mysys/my_symlink2.c @@ -92,27 +92,6 @@ File my_create_with_symlink(const char *linkname, const char *filename, } /* - If the file was a symlink, delete both symlink and the file which the - symlink pointed to. -*/ - -int my_delete_with_symlink(const char *name, myf MyFlags) -{ - char link_name[FN_REFLEN]; - int was_symlink= (!my_disable_symlinks && - !my_readlink(link_name, name, MYF(0))); - int result; - DBUG_ENTER("my_delete_with_symlink"); - - if (!(result=my_delete(name, MyFlags))) - { - if (was_symlink) - result=my_delete(link_name, MyFlags); - } - DBUG_RETURN(result); -} - -/* If the file is a normal file, just rename it. If the file is a symlink: - Create a new file with the name 'to' that points at |