]> source.dussan.org Git - nextcloud-server.git/commitdiff
Normalize getUnjailedPath 11770/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Thu, 11 Oct 2018 10:54:45 +0000 (12:54 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Thu, 11 Oct 2018 12:49:32 +0000 (14:49 +0200)
Fixes #11637

If we do not normalize the unjailed path we might end up with a path
like files/user/folder/. which can break on objectstores

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
lib/private/Files/Storage/Wrapper/Jail.php

index adee8ced77247174f2b202bf1380e865e01679f0..56514af6d80150f3ed9ea03466f0d6c82f92650d 100644 (file)
@@ -27,6 +27,7 @@ namespace OC\Files\Storage\Wrapper;
 
 use OC\Files\Cache\Wrapper\CacheJail;
 use OC\Files\Cache\Wrapper\JailPropagator;
+use OC\Files\Filesystem;
 use OCP\Files\Storage\IStorage;
 use OCP\Lock\ILockingProvider;
 
@@ -56,7 +57,7 @@ class Jail extends Wrapper {
                if ($path === '') {
                        return $this->rootPath;
                } else {
-                       return $this->rootPath . '/' . $path;
+                       return Filesystem::normalizePath($this->rootPath . '/' . $path);
                }
        }