summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2011-08-04 11:42:29 +0200
committerCaolán McNamara <caolanm@redhat.com>2011-08-08 13:04:50 +0100
commitada4759219efa816ec4c4d29c40cd1428c38e5d4 (patch)
treefe7c063af5f98728d7a8a90547e4d7f3b850c921
parentadd test files (diff)
downloadcore-ada4759219efa816ec4c4d29c40cd1428c38e5d4.tar.gz
core-ada4759219efa816ec4c4d29c40cd1428c38e5d4.zip
osl_getAbsoluteFileURL symlinks allowed: ".", ".." still treated
-rw-r--r--sal/osl/unx/file_url.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sal/osl/unx/file_url.cxx b/sal/osl/unx/file_url.cxx
index 1d69faa1e052..a2a3ddad3f38 100644
--- a/sal/osl/unx/file_url.cxx
+++ b/sal/osl/unx/file_url.cxx
@@ -669,7 +669,9 @@ oslFileError osl_getAbsoluteFileURL(rtl_uString* ustrBaseDirURL, rtl_uString* u
rtl::OUString base;
sal_Int32 last_slash = unresolved_path.lastIndexOf( UNICHAR_SLASH );
- if (last_slash >= 0 && last_slash + 1 < unresolved_path.getLength())
+ if (last_slash >= 0 && last_slash + 1 < unresolved_path.getLength()
+ && ! ( last_slash + 2 == unresolved_path.getLength() && unresolved_path.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("."), last_slash + 1) )
+ && ! ( last_slash + 3 == unresolved_path.getLength() && unresolved_path.matchAsciiL(RTL_CONSTASCII_STRINGPARAM(".."), last_slash + 1) ))
{
base = unresolved_path.copy(last_slash+1);
unresolved_path = unresolved_path.copy(0, last_slash);