summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-11-10 17:02:35 +0100
committerRobin Appelman <robin@icewind.nl>2017-11-10 17:03:27 +0100
commit56fd462718f2a60d1f9fa2955db28fdc1a5e39b9 (patch)
treeb1e5f33ede62671a46614eb06dcbed611f82764c /apps/files_sharing/lib
parentc7e5bc0f9ab6f58bf9a47dd0c3795e1183419652 (diff)
downloadnextcloud-server-56fd462718f2a60d1f9fa2955db28fdc1a5e39b9.tar.gz
nextcloud-server-56fd462718f2a60d1f9fa2955db28fdc1a5e39b9.zip
Use the correct root for shared jail when the source storage is also a jail
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/Cache.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php
index b3366b29ee3..e08da0d73e5 100644
--- a/apps/files_sharing/lib/Cache.php
+++ b/apps/files_sharing/lib/Cache.php
@@ -30,6 +30,7 @@ namespace OCA\Files_Sharing;
use OC\Files\Cache\FailedCache;
use OC\Files\Cache\Wrapper\CacheJail;
+use OC\Files\Storage\Wrapper\Jail;
use OCP\Files\Cache\ICacheEntry;
/**
@@ -62,9 +63,21 @@ class Cache extends CacheJail {
$this->storage = $storage;
$this->sourceRootInfo = $sourceRootInfo;
$this->numericId = $sourceRootInfo->getStorageId();
+
+ $absoluteRoot = $this->sourceRootInfo->getPath();
+
+ // the sourceRootInfo path is the absolute path of the folder in the "real" storage
+ // in the case where a folder is shared from a Jail we need to ensure that the share Jail
+ // has it's root set relative to the source Jail
+ $currentStorage = $storage->getSourceStorage();
+ if ($currentStorage->instanceOfStorage(Jail::class)) {
+ /** @var Jail $currentStorage */
+ $absoluteRoot = $currentStorage->getJailedPath($absoluteRoot);
+ }
+
parent::__construct(
null,
- $this->sourceRootInfo->getPath()
+ $absoluteRoot
);
}