summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-08-23 22:15:38 +0200
committerGitHub <noreply@github.com>2016-08-23 22:15:38 +0200
commit2f1b17d44a854221a4b3c461df80d0522ac3c8b5 (patch)
tree23893d214363f052928264c4ffdc85b51c379be8 /apps
parent3ed102497e2a3b732a0c7e91398b5bb6d147d12a (diff)
parenta0c2342c20d874a87335a3e1c21bbfa05a71a776 (diff)
downloadnextcloud-server-2f1b17d44a854221a4b3c461df80d0522ac3c8b5.tar.gz
nextcloud-server-2f1b17d44a854221a4b3c461df80d0522ac3c8b5.zip
Merge pull request #1007 from nextcloud/shared-storage-non-recursive
Fix shared storage recursive setup
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/SharedMount.php2
-rw-r--r--apps/files_sharing/lib/sharedstorage.php30
2 files changed, 15 insertions, 17 deletions
diff --git a/apps/files_sharing/lib/SharedMount.php b/apps/files_sharing/lib/SharedMount.php
index d160eb24228..2b562c4b4f1 100644
--- a/apps/files_sharing/lib/SharedMount.php
+++ b/apps/files_sharing/lib/SharedMount.php
@@ -244,7 +244,7 @@ class SharedMount extends MountPoint implements MoveableMount {
$query = $builder->select('storage')
->from('filecache')
- ->where($builder->expr()->eq('fileid', $builder->createNamedParameter($this->getShare()->getNodeId())));
+ ->where($builder->expr()->eq('fileid', $builder->createNamedParameter($this->getStorageRootId())));
return $query->execute()->fetchColumn();
}
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index 92900ccda69..6dec020982e 100644
--- a/apps/files_sharing/lib/sharedstorage.php
+++ b/apps/files_sharing/lib/sharedstorage.php
@@ -61,11 +61,6 @@ class Shared extends \OC\Files\Storage\Wrapper\Jail implements ISharedStorage {
*/
private $sourceRootInfo;
- /**
- * @var IStorage
- */
- private $sourceStorage;
-
/** @var string */
private $user;
@@ -83,13 +78,9 @@ class Shared extends \OC\Files\Storage\Wrapper\Jail implements ISharedStorage {
$this->user = $arguments['user'];
- Filesystem::initMountPoints($this->superShare->getShareOwner());
- $sourcePath = $this->ownerView->getPath($this->superShare->getNodeId());
- list($storage, $internalPath) = $this->ownerView->resolvePath($sourcePath);
-
parent::__construct([
- 'storage' => $storage,
- 'root' => $internalPath,
+ 'storage' => null,
+ 'root' => null,
]);
}
@@ -101,9 +92,11 @@ class Shared extends \OC\Files\Storage\Wrapper\Jail implements ISharedStorage {
try {
Filesystem::initMountPoints($this->superShare->getShareOwner());
$sourcePath = $this->ownerView->getPath($this->superShare->getNodeId());
- list($this->sourceStorage, $sourceInternalPath) = $this->ownerView->resolvePath($sourcePath);
- $this->sourceRootInfo = $this->sourceStorage->getCache()->get($sourceInternalPath);
+ list($this->storage, $this->rootPath) = $this->ownerView->resolvePath($sourcePath);
+ $this->sourceRootInfo = $this->storage->getCache()->get($this->rootPath);
} catch (\Exception $e) {
+ $this->storage = new FailedStorage(['exception' => $e]);
+ $this->rootPath = '';
$this->logger->logException($e);
}
}
@@ -302,13 +295,13 @@ class Shared extends \OC\Files\Storage\Wrapper\Jail implements ISharedStorage {
public function getCache($path = '', $storage = null) {
$this->init();
- if (is_null($this->sourceStorage)) {
+ if (is_null($this->storage) || $this->storage instanceof FailedStorage) {
return new FailedCache(false);
}
if (!$storage) {
$storage = $this;
}
- return new \OCA\Files_Sharing\Cache($storage, $this->sourceStorage, $this->sourceRootInfo);
+ return new \OCA\Files_Sharing\Cache($storage, $this->storage, $this->sourceRootInfo);
}
public function getScanner($path = '', $storage = null) {
@@ -409,7 +402,12 @@ class Shared extends \OC\Files\Storage\Wrapper\Jail implements ISharedStorage {
}
public function getSourceStorage() {
- return $this->sourceStorage;
+ return $this->getWrapperStorage();
+ }
+
+ public function getWrapperStorage() {
+ $this->init();
+ return $this->storage;
}
public function file_get_contents($path) {