diff options
author | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-02-27 19:20:18 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-02-27 19:20:18 +0100 |
commit | 3ebb4b883370da9528b7482b8ba4ed9521f07553 (patch) | |
tree | 317df6a325229e869ab1e5d3bc9d08f374d89cde /mysys/my_access.c | |
parent | f0c682858f26efcebabb558068aa567eed44632e (diff) | |
download | mariadb-git-3ebb4b883370da9528b7482b8ba4ed9521f07553.tar.gz |
because of the high cost associated with fake symdir resolution, disable symbolic-links on Windows by default. Real symlinks (Vista+) as well as NTFS junctions (prior to Vista) do not require this parameter
Diffstat (limited to 'mysys/my_access.c')
-rw-r--r-- | mysys/my_access.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/mysys/my_access.c b/mysys/my_access.c index 210946d50a8..d7d06f814d6 100644 --- a/mysys/my_access.c +++ b/mysys/my_access.c @@ -26,11 +26,6 @@ path Path to file amode Access method - DESCRIPTION - This function wraps the normal access method because the access - available in MSVCRT> +reports that filenames such as LPT1 and - COM1 are valid (they are but should not be so for us). - RETURN VALUES 0 ok -1 error (We use -1 as my_access is mapped to access on other platforms) @@ -38,12 +33,11 @@ int my_access(const char *path, int amode) { - WIN32_FILE_ATTRIBUTE_DATA fileinfo; - BOOL result; - - result= GetFileAttributesEx(path, GetFileExInfoStandard, &fileinfo); - if (! result || - (fileinfo.dwFileAttributes & FILE_ATTRIBUTE_READONLY) && (amode & W_OK)) + DWORD attributes; + + attributes = GetFileAttributes(path); + if (attributes == INVALID_FILE_ATTRIBUTES || + (attributes & FILE_ATTRIBUTE_READONLY) && (amode & W_OK)) { my_errno= errno= EACCES; return -1; |