summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRavinder Thakur <ravinder.thakur@oracle.com>2012-12-13 20:33:44 +0530
committerRavinder Thakur <ravinder.thakur@oracle.com>2012-12-13 20:33:44 +0530
commit9258223200047222e52463b49f6f1c83ca042075 (patch)
tree2e52b0a9f3f63f6ea4ed62f0f9c3209cd57865ba /include
parenta01e70c27843ad6f3c1d4d7a9922dedcb8941b6b (diff)
downloadmariadb-git-9258223200047222e52463b49f6f1c83ca042075.tar.gz
bug#11761752: DO NOT ALLOW USE OF ALTERNATE DATA STREAMS ON NTFS FILESYSTEM.
File names with colon are being disallowed because of the Alternate Data Stream (ADS) feature of NTFS that could be misused. ADS allows data to be written to alternate streams of a normal file. The data in alternate streams cannot be seen by normal tools on Windows (explorer, cmd.exe). As a result someone can use this feature to hide large amount of data in alternate streams and admins will have no easy way of figuring out the files that are using that disk space. The fix also disallows ADS in the scenarios where file name is passed as some dynamic variable. An important thing about the fix is that it DOES NOT disallow ADS file names if they are not dynamic (i.e. if the file is created by using some option that needs local access to the MySQL server, for example error log file). The reasoning is that if some MySQL option related to files requires access to the local machine (it is not dynamic), then user can very well create data in ADS by some other means. This fixes only those scenarios which can allow users to create data in ADS over the wire. File names with colon are being disallowed only on Windows. UNIX (Linux in particular) supports NTFS, but it will not be a common scenario for someone to configure a NTFS file system to store MySQL data on Linux. Changes in file bug11761752-master.opt are needed due to bug number 15937938.
Diffstat (limited to 'include')
-rw-r--r--include/my_sys.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/my_sys.h b/include/my_sys.h
index f6cd9dada99..6bdb95e9707 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -649,6 +649,7 @@ extern File my_sopen(const char *path, int oflag, int shflag, int pmode);
#endif
extern int check_if_legal_filename(const char *path);
extern int check_if_legal_tablename(const char *path);
+extern my_bool is_filename_allowed(const char *name, size_t length);
#if defined(__WIN__) && defined(__NT__)
extern int nt_share_delete(const char *name,myf MyFlags);