]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix copy from jailed storage 6061/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Wed, 9 Aug 2017 09:56:31 +0000 (11:56 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Thu, 10 Aug 2017 06:07:00 +0000 (08:07 +0200)
If we have a jailed storage we must also fix the internal path on copy.
Else we pass in the wrong path.

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

index 70cb2e0ccc423b5037b79f32769f53a3e9cb4e3d..c4e2dd6833988e96893e66851ab740838430bf19 100644 (file)
@@ -411,6 +411,12 @@ class Local extends \OC\Files\Storage\Common {
         */
        public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {
                if ($sourceStorage->instanceOfStorage('\OC\Files\Storage\Local')) {
+                       if ($sourceStorage->instanceOfStorage(Jail::class)) {
+                               /**
+                                * @var \OC\Files\Storage\Wrapper\Jail $sourceStorage
+                                */
+                               $sourceInternalPath = $sourceStorage->getUnjailedPath($sourceInternalPath);
+                       }
                        /**
                         * @var \OC\Files\Storage\Local $sourceStorage
                         */