summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
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
);
}