Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-03-08 16:42:04 +0300
committerThomas Müller <thomas.mueller@tmit.eu>2016-03-08 16:42:04 +0300
commitf9a80a9c12d80cd8979d21a4c956d936a3616b63 (patch)
treec5835628820ee3778b3a25be0055a2962d3ce8bf
parent9232a124e22e65dbdb36e6b103bf6791e04cb140 (diff)
parentd63f5561fb793c556a307088f5e6ec7f3127106a (diff)
Merge pull request #22945 from owncloud/stable9-fixsharemountrecursion
[stable9] Fix share mounting recursion
-rw-r--r--apps/files_sharing/lib/sharedstorage.php2
-rw-r--r--lib/private/files/config/usermountcache.php9
-rw-r--r--lib/private/util.php2
3 files changed, 10 insertions, 3 deletions
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index 600599d7175..6998f94698e 100644
--- a/apps/files_sharing/lib/sharedstorage.php
+++ b/apps/files_sharing/lib/sharedstorage.php
@@ -85,6 +85,7 @@ class Shared extends \OC\Files\Storage\Common implements ISharedStorage {
}
private function isValid() {
+ $this->init();
return ($this->sourceRootInfo->getPermissions() & Constants::PERMISSION_SHARE) === Constants::PERMISSION_SHARE;
}
@@ -566,6 +567,7 @@ class Shared extends \OC\Files\Storage\Common implements ISharedStorage {
}
public function getCache($path = '', $storage = null) {
+ $this->init();
if (!$storage) {
$storage = $this;
}
diff --git a/lib/private/files/config/usermountcache.php b/lib/private/files/config/usermountcache.php
index 58e7e9d156d..78b19972787 100644
--- a/lib/private/files/config/usermountcache.php
+++ b/lib/private/files/config/usermountcache.php
@@ -24,6 +24,7 @@ namespace OC\Files\Config;
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use OC\Files\Filesystem;
+use OCA\Files_Sharing\SharedMount;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\Files\Config\ICachedMountInfo;
use OCP\Files\Config\IUserMountCache;
@@ -75,12 +76,16 @@ class UserMountCache implements IUserMountCache {
public function registerMounts(IUser $user, array $mounts) {
// filter out non-proper storages coming from unit tests
$mounts = array_filter($mounts, function (IMountPoint $mount) {
- return $mount->getStorage() && $mount->getStorage()->getCache();
+ return $mount instanceof SharedMount || $mount->getStorage() && $mount->getStorage()->getCache();
});
/** @var ICachedMountInfo[] $newMounts */
$newMounts = array_map(function (IMountPoint $mount) use ($user) {
$storage = $mount->getStorage();
- $rootId = (int)$storage->getCache()->getId('');
+ if ($storage->instanceOfStorage('\OC\Files\Storage\Shared')) {
+ $rootId = (int)$storage->getShare()['file_source'];
+ } else {
+ $rootId = (int)$storage->getCache()->getId('');
+ }
$storageId = (int)$storage->getStorageCache()->getNumericId();
// filter out any storages which aren't scanned yet since we aren't interested in files from those storages (yet)
if ($rootId === -1) {
diff --git a/lib/private/util.php b/lib/private/util.php
index 6884e55c243..f6191b96aa2 100644
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -165,7 +165,7 @@ class OC_Util {
// install storage availability wrapper, before most other wrappers
\OC\Files\Filesystem::addStorageWrapper('oc_availability', function ($mountPoint, $storage) {
- if (!$storage->isLocal()) {
+ if (!$storage->instanceOfStorage('\OC\Files\Storage\Shared') && !$storage->isLocal()) {
return new \OC\Files\Storage\Wrapper\Availability(['storage' => $storage]);
}
return $storage;