summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2011-05-04 14:29:23 +0300
committerGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2011-05-04 14:29:23 +0300
commite76cd16967242b18a08f2f2a9608c85a6d1699d2 (patch)
treef6203178a6b0af093ece4a5d76b06c6c00754ec4 /mysys
parentbe9fba494c0949513eafcff7a0a2695d1fd60f98 (diff)
parent59d7516005af28dce97c3f4251e2d7da2e31d203 (diff)
downloadmariadb-git-e76cd16967242b18a08f2f2a9608c85a6d1699d2.tar.gz
Merged 5.0-security->5.1-security
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_symlink.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/mysys/my_symlink.c b/mysys/my_symlink.c
index 59d929f9a61..82fe6cf7c4f 100644
--- a/mysys/my_symlink.c
+++ b/mysys/my_symlink.c
@@ -144,24 +144,23 @@ int my_realpath(char *to, const char *filename, myf MyFlags)
result= -1;
}
DBUG_RETURN(result);
-#else
-#ifdef _WIN32
- int ret= GetFullPathName(filename,FN_REFLEN,
- to,
- NULL);
+#elif defined(_WIN32)
+ int ret= GetFullPathName(filename,FN_REFLEN, to, NULL);
if (ret == 0 || ret > FN_REFLEN)
{
- if (ret > FN_REFLEN)
- my_errno= ENAMETOOLONG;
- else
- my_errno= EACCES;
+ my_errno= (ret > FN_REFLEN) ? ENAMETOOLONG : GetLastError();
if (MyFlags & MY_WME)
my_error(EE_REALPATH, MYF(0), filename, my_errno);
- return -1;
+ /*
+ GetFullPathName didn't work : use my_load_path() which is a poor
+ substitute original name but will at least be able to resolve
+ paths that starts with '.'.
+ */
+ my_load_path(to, filename, NullS);
+ return -1;
}
#else
my_load_path(to, filename, NullS);
#endif
return 0;
-#endif
}