diff options
author | Robin Appelman <robin@icewind.nl> | 2017-04-12 14:56:51 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-04-12 14:56:51 +0200 |
commit | 8500debe79545dfb6a982de1d492478f9db84370 (patch) | |
tree | 6bc9c780d0b4c5b2ae5946c5ac23b2cbb8e6c13d /lib | |
parent | 2f949f4515158ad9e23b108f32c653c9892dab8a (diff) | |
download | nextcloud-server-8500debe79545dfb6a982de1d492478f9db84370.tar.gz nextcloud-server-8500debe79545dfb6a982de1d492478f9db84370.zip |
use unjailed path when moving files out of a shared storage
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Storage/Local.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php index 5597c0c64cc..4eb9fb13deb 100644 --- a/lib/private/Files/Storage/Local.php +++ b/lib/private/Files/Storage/Local.php @@ -35,6 +35,7 @@ namespace OC\Files\Storage; +use OC\Files\Storage\Wrapper\Jail; use OCP\Files\ForbiddenException; /** @@ -371,7 +372,7 @@ class Local extends \OC\Files\Storage\Common { return $fullPath; } - \OCP\Util::writeLog('core', "Following symlinks is not allowed ('$fullPath' -> '$realPath' not inside '{$this->realDataDir}')", \OCP\Util::ERROR); + \OCP\Util::writeLog('core', "Following symlinks is not allowed ('$fullPath' -> '$realPath' not inside '{$this->realDataDir}')", \OCP\Util::ERROR); throw new ForbiddenException('Following symlinks is not allowed', false); } @@ -427,7 +428,13 @@ class Local extends \OC\Files\Storage\Common { * @return bool */ public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) { - if ($sourceStorage->instanceOfStorage('\OC\Files\Storage\Local')) { + if ($sourceStorage->instanceOfStorage(Local::class)) { + if ($sourceStorage->instanceOfStorage(Jail::class)) { + /** + * @var \OC\Files\Storage\Wrapper\Jail $sourceStorage + */ + $sourceInternalPath = $sourceStorage->getUnjailedPath($sourceInternalPath); + } /** * @var \OC\Files\Storage\Local $sourceStorage */ |